public class SQLConnection extends Object implements org.pentaho.platform.engine.core.system.IPentahoLoggingConnection, org.pentaho.commons.connection.ILimitableConnection
| Modifier and Type | Field and Description |
|---|---|
static int |
CONCUR_READONLY |
static int |
CONCUR_UPDATABLE |
static int |
RESULTSET_FORWARDONLY |
static int |
RESULTSET_SCROLLABLE |
CLASSNAME_KEY, CONNECTION, DRIVER_KEY, HQL_DATASOURCE, JNDI_NAME_KEY, KEYS, LOCATION_KEY, MDX_DATASOURCE, MDX_OLAP4J_DATASOURCE, NONE_DATASOURCE, PASSWORD_KEY, PROVIDER, QUERY_KEY, SQL_DATASOURCE, USERNAME_KEY, XML_DATASOURCE| Constructor and Description |
|---|
SQLConnection() |
SQLConnection(String driverName,
String location,
String userName,
String password,
org.pentaho.platform.api.engine.ILogger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearWarnings() |
void |
close() |
boolean |
connect(Properties props) |
int |
execute(String query) |
int |
execute(String query,
int scrollType,
int concur) |
org.pentaho.commons.connection.IPentahoResultSet |
executeQuery(String query)
Executes the specified query.
|
org.pentaho.commons.connection.IPentahoResultSet |
executeQuery(String query,
int scrollType,
int concur)
Executes the specified query with the defined parameters
|
String |
getDatasourceType()
return datasource type SQL
|
int |
getFetchSize() |
String |
getLastQuery() |
int |
getMaxRows() |
Connection |
getNativeConnection() |
int |
getQueryTimeout()
Returns the query timeout value (in seconds)
|
boolean |
getReadOnly()
Returns the state of the readonly flag
|
org.pentaho.commons.connection.IPentahoResultSet |
getResultSet() |
boolean |
initialized() |
boolean |
isClosed() |
boolean |
isFallBackToNonscrollableOnError() |
boolean |
isForcedForwardOnly() |
boolean |
isReadOnly() |
org.pentaho.commons.connection.IPentahoResultSet |
prepareAndExecuteQuery(String query,
List parameters) |
org.pentaho.commons.connection.IPentahoResultSet |
prepareAndExecuteQuery(String query,
List parameters,
int scrollType,
int concur) |
boolean |
preparedQueriesSupported() |
void |
setFallBackToNonscrollableOnError(boolean fallBackToNonscrollableOnError) |
void |
setFetchSize(int fetchSize) |
void |
setForcedForwardOnly(boolean forcedForwardOnly) |
void |
setLogger(org.pentaho.platform.api.engine.ILogger logger) |
void |
setMaxRows(int maxRows) |
void |
setProperties(Properties props) |
void |
setQueryTimeout(int timeInSec)
Sets the valid of the timeout (in seconds)
|
void |
setReadOnly(boolean value)
Sets the connection object to readonly.
|
public static final int RESULTSET_SCROLLABLE
public static final int RESULTSET_FORWARDONLY
public static final int CONCUR_READONLY
public static final int CONCUR_UPDATABLE
public void setLogger(org.pentaho.platform.api.engine.ILogger logger)
setLogger in interface org.pentaho.platform.engine.core.system.IPentahoLoggingConnectionpublic void setProperties(Properties props)
setProperties in interface org.pentaho.commons.connection.IPentahoConnectionpublic void setQueryTimeout(int timeInSec)
setQueryTimeout in interface org.pentaho.commons.connection.ILimitableConnectionpublic void setReadOnly(boolean value)
value - public int getQueryTimeout()
public boolean initialized()
initialized in interface org.pentaho.commons.connection.IPentahoConnectionpublic String getDatasourceType()
getDatasourceType in interface org.pentaho.commons.connection.IPentahoConnectionpublic void close()
close in interface org.pentaho.commons.connection.IPentahoConnectionpublic String getLastQuery()
getLastQuery in interface org.pentaho.commons.connection.IPentahoConnectionpublic org.pentaho.commons.connection.IPentahoResultSet executeQuery(String query) throws SQLException, InterruptedException, org.pentaho.platform.api.engine.PentahoSystemException
executeQuery in interface org.pentaho.commons.connection.IPentahoConnectionquery - the query to executeSQLException - indicates an error running the queryInterruptedException - indicates that the query took longer than the allowed timeout valueorg.pentaho.platform.api.engine.PentahoSystemExceptionpublic org.pentaho.commons.connection.IPentahoResultSet executeQuery(String query, int scrollType, int concur) throws SQLException, InterruptedException, org.pentaho.platform.api.engine.PentahoSystemException
query - the query to be executedscrollType - concur - SQLException - indicates an error running the queryInterruptedException - indicates the query took longer than allowable by the query timeoutorg.pentaho.platform.api.engine.PentahoSystemExceptionpublic org.pentaho.commons.connection.IPentahoResultSet prepareAndExecuteQuery(String query, List parameters) throws SQLException
prepareAndExecuteQuery in interface org.pentaho.commons.connection.IPentahoConnectionSQLExceptionpublic org.pentaho.commons.connection.IPentahoResultSet prepareAndExecuteQuery(String query, List parameters, int scrollType, int concur) throws SQLException
SQLExceptionpublic boolean preparedQueriesSupported()
preparedQueriesSupported in interface org.pentaho.commons.connection.IPentahoConnectionpublic boolean isClosed()
isClosed in interface org.pentaho.commons.connection.IPentahoConnectionpublic boolean isReadOnly()
isReadOnly in interface org.pentaho.commons.connection.IPentahoConnectionpublic void clearWarnings()
clearWarnings in interface org.pentaho.commons.connection.IPentahoConnectionpublic org.pentaho.commons.connection.IPentahoResultSet getResultSet()
getResultSet in interface org.pentaho.commons.connection.IPentahoConnectionpublic boolean connect(Properties props)
connect in interface org.pentaho.commons.connection.IPentahoConnectionpublic int execute(String query) throws SQLException
SQLExceptionpublic int execute(String query, int scrollType, int concur) throws SQLException
SQLExceptionpublic Connection getNativeConnection()
public int getFetchSize()
public void setFetchSize(int fetchSize)
setFetchSize in interface org.pentaho.commons.connection.IPentahoConnectionfetchSize - The fetchSize to set.public int getMaxRows()
public void setMaxRows(int maxRows)
setMaxRows in interface org.pentaho.commons.connection.ILimitableConnectionsetMaxRows in interface org.pentaho.commons.connection.IPentahoConnectionmaxRows - The maxRows to set.public boolean getReadOnly()
public void setFallBackToNonscrollableOnError(boolean fallBackToNonscrollableOnError)
public boolean isFallBackToNonscrollableOnError()
public boolean isForcedForwardOnly()
public void setForcedForwardOnly(boolean forcedForwardOnly)