|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--com.sap.sql.NativeSQLAccess
This class allows to circumvent Open SQL restrictions on specific databaseses. It makes it possible to prepare and execute Native SQL statements on an Open SQL connection. Additionally it offers methods to determine the database vendor underlying an Open SQL conncetion.
| Field Summary | |
static int |
VENDOR_DB2_UDB
The constant that is used to identify a DB2 UDB for UNIX and NT database product. |
static int |
VENDOR_DB2_UDB_AS400
The constant that is used to identify a DB2 UDB for AS/400 database product. |
static int |
VENDOR_DB2_UDB_OS390
The constant that is used to identify a DB2 UDB for OS/390 database product. |
static int |
VENDOR_INFORMIX
The constant that is used to identify an Informix database product. |
static int |
VENDOR_MS_SQL_SERVER
The constant that is used to identify a MS SQL Server database product. |
static int |
VENDOR_ORACLE
The constant that is used to identify an Oracle database product. |
static int |
VENDOR_SAPDB
The constant that is used to identify a SAP DB database product. |
static int |
VENDOR_UNKNOWN
The constant that is used to identify an unknown database product. |
| Method Summary | |
static java.sql.Statement |
createNativeStatement(java.sql.Connection connection)
This method allows to create a Statement object on the
Native SQL connection underlying a given Open SQL connection.
|
static java.sql.Statement |
createNativeStatement(java.sql.Connection connection,
int resultSetType,
int resultSetConcurrency)
This method allows to create a Statement object on the
Native SQL connection underlying a given Open SQL connection.
|
static java.sql.DatabaseMetaData |
getNativeMetaData(java.sql.Connection connection)
This method gives access to the DatabaseMetaData of the
Native SQL connection underlying an Open SQL connection. |
static int |
getVendorID(java.sql.Connection connection)
Gets the product identifier VENDOR_<vendor name> for the given connection. |
static int |
getVendorID(java.lang.String productName)
Gets the product identifier VENDOR_<vendor name> that corresponds to the given database product name. |
static java.lang.String |
getVendorName(java.sql.Connection connection)
Gets the corresponding database product name for the given database connection. |
static java.lang.String |
getVendorName(int vendorID)
Gets the database product name that corresponds to the given product identifier. |
static java.lang.String[] |
getVendorNames()
Gets an array of all supported database product names. |
static java.lang.String |
getVendorTitle(int vendorID)
Gets the database product title for the given product identifier. |
static boolean |
isTransientSQLError(java.sql.Connection connection,
java.sql.SQLException exception)
Returns true, if the SQLException originates from a
database error that is of transient nature, false
otherwise. |
static java.sql.CallableStatement |
prepareNativeCall(java.sql.Connection connection,
java.lang.String sql)
This method allows to prepare a CallableStatement object on
the Native SQL connection underlying a given Open SQL
connection. |
static java.sql.CallableStatement |
prepareNativeCall(java.sql.Connection connection,
java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
This method allows to prepare a CallableStatement object on
the Native SQL connection underlying a given Open SQL
connection. |
static java.sql.PreparedStatement |
prepareNativeStatement(java.sql.Connection connection,
java.lang.String sql)
This method allows to prepare a PreparedStatement object on
the Native SQL connection underlying a given Open SQL
connection. |
static java.sql.PreparedStatement |
prepareNativeStatement(java.sql.Connection connection,
java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
This method allows to prepare a PreparedStatement object on
the Native SQL connection underlying a given Open SQL
connection. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int VENDOR_UNKNOWN
public static final int VENDOR_DB2_UDB
public static final int VENDOR_DB2_UDB_AS400
public static final int VENDOR_DB2_UDB_OS390
public static final int VENDOR_INFORMIX
public static final int VENDOR_MS_SQL_SERVER
public static final int VENDOR_ORACLE
public static final int VENDOR_SAPDB
| Method Detail |
public static java.sql.DatabaseMetaData getNativeMetaData(java.sql.Connection connection)
throws java.sql.SQLException
DatabaseMetaData of the
Native SQL connection underlying an Open SQL connection.connection - a database connectionDatabaseMetaData object for the Native SQL
connection underlying the given connection connectionjava.sql.SQLException - if a database error occursConnection.getMetaData()
public static java.sql.Statement createNativeStatement(java.sql.Connection connection)
throws java.sql.SQLException
Statement object on the
Native SQL connection underlying a given Open SQL connection.
It works just like the createStatement() method on the
underlying Native SQL connection.
This allows to circumvent the compliance check with Open SQL and might be used to exploit database specific SQL that doesn't obey to the Open SQL subset.
connection - a database connectionStatement object for the Native SQL connection
underlying the given connection connection.java.sql.SQLException - if a database error occursConnection.createStatement()
public static java.sql.Statement createNativeStatement(java.sql.Connection connection,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
Statement object on the
Native SQL connection underlying a given Open SQL connection.
It works just like the createStatement(int, int) method on
the underlying Native SQL connection.
This allows to circumvent the compliance check with Open SQL and might be used to exploit database specific SQL that doesn't obey to the Open SQL subset.
connection - a database connectionresultSetType - a result set type; see java.sql.ResultSet.TYPE_XXXresultSetConcurrency - a concurrency type; see java.sql.ResultSet.CONCUR_XXXStatement object for the Native SQL connection
underlying the given connection connection.java.sql.SQLException - if a database error occursConnection.createStatement(int, int)
public static java.sql.PreparedStatement prepareNativeStatement(java.sql.Connection connection,
java.lang.String sql)
throws java.sql.SQLException
PreparedStatement object on
the Native SQL connection underlying a given Open SQL
connection. It works just like the prepareStatement(String)
method on the underlying Native SQL connection.
This allows to circumvent the compliance check with Open SQL and might be used to exploit database specific SQL that doesn't obey to the Open SQL subset.
connection - a database connectionsql - the SQL statement to be preparedPreparedStatement object for the Native SQL
connection underlying the given connection connection.java.sql.SQLException - if a database error occursConnection.prepareStatement(String)
public static java.sql.PreparedStatement prepareNativeStatement(java.sql.Connection connection,
java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
PreparedStatement object on
the Native SQL connection underlying a given Open SQL
connection. It works just like the
prepareStatement(String, int, int) method on the underlying
Native SQL connection.
This allows to circumvent the compliance check with Open SQL and might be used to exploit database specific SQL that doesn't obey to the Open SQL subset.
connection - a database connectionsql - the SQL statement to be preparedresultSetType - a result set type; see java.sql.ResultSet.TYPE_XXXresultSetConcurrency - a concurrency type; see java.sql.ResultSet.CONCUR_XXXPreparedStatement object for the Native SQL
connection underlying the given connection connection.java.sql.SQLException - if a database error occursConnection.prepareStatement(String, int, int)
public static java.sql.CallableStatement prepareNativeCall(java.sql.Connection connection,
java.lang.String sql)
throws java.sql.SQLException
CallableStatement object on
the Native SQL connection underlying a given Open SQL
connection. It works just like the
prepareCall(String) method on the underlying
Native SQL connection.
This allows to circumvent the compliance check with Open SQL and might be used to exploit database specific SQL that doesn't obey to the Open SQL subset.
connection - a database connectionsql - the SQL statement to be preparedCallableStatement object for the Native SQL
connection underlying the given connection connection.java.sql.SQLException - if a database error occursConnection.prepareCall(String)
public static java.sql.CallableStatement prepareNativeCall(java.sql.Connection connection,
java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
CallableStatement object on
the Native SQL connection underlying a given Open SQL
connection. It works just like the
prepareCall(String, int, int) method on the underlying
Native SQL connection.
This allows to circumvent the compliance check with Open SQL and might be used to exploit database specific SQL that doesn't obey to the Open SQL subset.
connection - a database connectionsql - the SQL statement to be preparedresultSetType - a result set type; see java.sql.ResultSet.TYPE_XXXresultSetConcurrency - a concurrency type; see java.sql.ResultSet.CONCUR_XXXCallableStatement object for the Native SQL
connection underlying the given connection connection.java.sql.SQLException - if a database error occursConnection.prepareCall(String, int, int)public static int getVendorID(java.lang.String productName)
The method returns VENDOR_UNKNOWN if the given database
product name is unknown.
productName - a database product namepublic static int getVendorID(java.sql.Connection connection)
The method returns VENDOR_UNKNOWN if the database product couldn't be determined for the given connection.
connection - a database connectionpublic static java.lang.String getVendorName(int vendorID)
The method returns the String "VENDOR_UNKNOWN" if the given
product identifier doesn't match with one of the defined product
identifiers VENDOR_<vendor name>.
vendorID - a database product identifierpublic static java.lang.String getVendorName(java.sql.Connection connection)
The method returns the String "VENDOR_UNKNOWN" if the
database product couldn't be determined for the given connection.
connection - a database connectionpublic static java.lang.String[] getVendorNames()
public static java.lang.String getVendorTitle(int vendorID)
vendorID - a database product identifier.
public static boolean isTransientSQLError(java.sql.Connection connection,
java.sql.SQLException exception)
throws java.sql.SQLException
true, if the SQLException originates from a
database error that is of transient nature, false
otherwise. Transient error means that,
with some likelihood, the error will disappear if the failing transaction
is re-executed. The current implementation only considers deadlocks as
transient errors. On database platforms that do not have a clear-cut
deadlock detection mechanism a timeout error may occur in a deadlock
situation, instead. Hence, the method also returns TRUE in case of a
timeout error on a database platform without deadlock detection.
Database systems do not have identical transactional behaviour in case of transient errors. Some database management systems roll back the complete transaction after timeout or deadlock errors, some database systems roll back the affected SQL statement only.This leads to the programming paradigm: In case of a transient error, it is not possible to re-execute the single statement that caused the error. The complete transaction has to be rolled back and, if desired, repeated.
connection - the database connection on which the exception occurred.exception - the SQL exception that is to be analysed.true, if the SQLException originates from a
database error that is of transient nature.java.sql.SQLException - if an error occurs
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||