solidDB Help : Programming : solidDB JDBC driver : JDBC driver interfaces and methods
  
JDBC driver interfaces and methods
The solidDB JDBC driver 2.0 is compatible with the JDBC 2.0 standard, and supports selected features of the JDBC 2.0 Optional Package (previously known as Standard Extension).
This topic describes the implementation differences in the solidDB JDBC API, as compared to the standard API. You can browse standard packages and interfaces in the java.sql and javax.sql packages, and see details of a particular implementation by checking the list of "All Known Implementing Classes".
For a description of how different data types are supported by the solidDB JDBC driver, see solidDB JDBC driver type conversion matrix.
Array
The java.sql.Array interface is not supported. This interface is used to map the SQL type, Array, in the Java programming language. It reflects the SQL-99 standard that is unavailable in the solidDB JDBC API.
Blob
The java.sql.Blob interface is not supported. This interface is used to map the SQL type, Blob, in the Java programming language. It reflects the SQL-99 standard that is unavailable in the solidDB JDBC API.
CallableStatement
The java.sql.CallableStatement interface can be used to call database stored procedures. Thus, the solidDB stored procedures can be used in JDBC in the same way as any other statement; the use of class CallableStatement is not necessary when you are writing applications on the solidDB server only. However, for portability reasons, using CallableStatement is a good choice.
Note The JDBC Driver allows for the creation of a Statement object that generates ResultSet objects with the given type and concurrency. This differs from the createStatement method in JDBC 1.0 because it allows the default result set type and result set concurrency type to be overridden.
Following are the differences from the standard CallableStatement interface that is defined in the JDBC API.
 
Method name
Notes
getArray(int i)
Not supported.
getBlob(int i)
Not supported.
getClob(int i)
Not supported.
getDate(int parameterIndex, Calendar cal)
Works as specified in Java API.
Uses a given Calendar object to specify time zone and locale, different from default ones. The same rule corresponds to other similar methods that operates with Calendar instances.
getObject (int i, Map map)
Not supported.
getRef(int i)
Not supported.
registerOutParameter(int parameterIndex, int sqlType, String typeName)
Not supported. This method throws an exception with the following message: "This method is not supported".
CLOB
The java.sql.Clob interface is not supported. This interface is used to map the SQL type, CLOB, in the Java programming language. It reflects the SQL-99 standard that is unavailable in the solidDB JDBC API.
Connection
The java.sql.Connection interface is a public interface. It is used to establish a connection (session) with a specified database. SQL statements are executed and results are returned within the context of a connection.
The following table lists the differences from the standard Connection interface that is defined in the JDBC API.
 
Method name
Notes
getTypeMap()
The solidDB JDBC API provides this method, but it always returns null.
isReadOnly()
The solidDB JDBC API supports only read-only connections and read-only transactions if the database is declared as read-only. This method always returns false.
nativeSQL(String sql)
Works as specified in Java API. The solidDB JDBC driver does not change the SQL that is passed to the solidDB server. The SQL query that the user passes is returned.
prepareCall(String sql)
Works as specified in Java API.
The escape call syntax is not supported.
setReadOnly(boolean readOnly)
The solidDB JDBC API supports only read-only database and read-only transactions if the database is declared as read-only. This method exists but does not affect the connection behavior.
setTransactionIsolation(int level)
Works as specified in Java API.
setTypeMap(Map map)
Not supported.
DatabaseMetaData
The java.sql.DatabaseMetaData interface is a public abstract interface. It provides general, comprehensive information about the database.
All methods for this interface are supported by the solidDB JDBC API.
For a description of how different data types are supported by the solidDB JDBC Driver, see solidDB JDBC driver type conversion matrix.
Driver
The java.sql.Driver interface is a public abstract interface. Every driver class implements this interface and all methods for this interface are supported by the solidDB JDBC API.
PreparedStatement
The java.sql.PreparedStatement interface is a public abstract interface. It extends the statement interface. It provides an object that represents a precompiled SQL statement.
The JDBC driver allows for the creation of a PreparedStatement object that generates ResultSet objects with the given type and concurrency. This differs from the prepareStatement method in JDBC 1.0 because it allows the default result set type and result set concurrency type to be overridden.
Subinterfaces: CallableStatement
The following table lists the differences from the standard PreparedStatement interface that is defined in the JDBC API.
 
Method name
Notes
setArray(int i, Array x)
Not supported.
setBlob(int I, Blob x)
Not supported.
setClob(int I, Clob x)
Not supported.
setObject(int parameterIndex, Object x)
Works as specified in Java API.
The following objects are not supported: BLOB, CLOB, ARRAY, REF, and object (USING java.util.Map).
setObject(int parameterIndex, Object x, int targetSqlType))
Not supported. This method throws an exception with the following message: "This method is not supported".
setObject(int parameterIndex, Object x, int targetSQLType, int scale)
Not supported. This method throws an exception with the following message: "This method is not supported"
setRef(int I, Ref x)
Not supported.
Ref
The java.sql.Ref interface is a public abstract interface.
This interface is a reference to an SQL structured type value in the database. This interface is not supported by the solidDB JDBC API.
ResultSet
The java.sql.ResultSet interface is a table of data that represents a database result set from a query statement. This object includes a cursor that points to its current row of data. The initial position of the cursor is before the first row. It is moved to the next row by the next method. When there are no more rows left in the result set, the method returns false; this allows the use of a WHILE loop to iterate through the result set.
The following table lists the differences from the standard ResultSet interface that is defined in the JDBC API.
 
Method name
Notes
getArray(int i)
Not supported.
getArray(String ColName)
Not supported.
getBigDecimal(String columnName)
Works as specified in Java API.
getCharacterStream(int columnIndex)
Works as specified in Java API.
The JDBC driver sets the designated parameter to the given Reader object at the given character length. When a large UNICODE value is input to a LONG VARCHAR/LONG WVARCHR parameter, you can send it by using a java.io.Reader. The JDBC driver reads the data from the stream as needed, until it reaches end-of-file. The driver does all the necessary conversion from UNICODE to the database CHAR format.
getCharacterStream(String columnName)
Works as specified in Java API. The note above also applies to this method.
getFetchSize()
Not supported.
getObject(int columnIndex)
Works as specified in Java API.
The following objects are not supported: BLOB, CLOB, ARRAY, REF, and object (USING java.util.Map).
getObject(int i, Map map)
Not supported.
getObject(String colName, Map map)
Not supported. This method throws an exception with the following message: This method is not supported
getRef(int i)
Not supported.
getRef(String colName)
Not supported.
refreshRow()
Not supported.
setFetchSize(int rows)
No operation in the solidDB JDBC API. Sets the value for the number of rows to be fetched from the database each time. The value a user sets with this method is ignored.
getCharacterStream(int columnIndex)
Works as specified in Java API.
The JDBC driver sets the designated parameter to the given Reader object at the given character length. When a large UNICODE value is input to a LONG VARCHAR/LONG WVARCHR parameter, you can send it by using a java.io.Reader. The JDBC driver reads the data from the stream as needed, until it reaches end-of-file. The driver does all the necessary conversion from UNICODE to the database CHAR format.
getCharacterStream(String columnName)
Works as specified in Java API. The note above also applies to this method.
getFetchSize()
Not supported.
getObject(int columnIndex)
Works as specified in Java API.
The following objects are not supported: BLOB, CLOB, ARRAY, REF, and object (USING java.util.Map).
getObject(int i, Map map)
Not supported.
getObject(String colName, Map map)
Not supported. This method throws an exception with the following message: This method is not supported
getRef(int i)
Not supported.
getRef(String colName)
Not supported.
refreshRow()
Not supported.
setFetchSize(int rows)
No operation in the solidDB JDBC API. Sets the value for the number of rows to be fetched from the database each time. The value a user sets with this method is ignored.
ResultSetMetaData
The java.sql.ResultSetMetaData interface is a public abstract interface. This interface is used to find out about the types and properties of the columns in a result set.
SQLData
The java.sql.SQLData interface is not supported. This interface is used to custom map SQL user-defined types. It reflects the SQL-99 standard that is unavailable in solidDB.
SQLInput
The java.sql.SQLInput interface is not supported. This interface is an input stream that represents an instance of an SQL structured or distinct type. It reflects the SQL-99 standard that is unavailable in solidDB.
SQLOutput
The java.sql.SQLOutput interface is not supported. This interface is an output stream that is used to write the attributes of a user-defined type back to the database. It reflects the SQL-99 standard that is unavailable in solidDB.
Statement
The java.sql.Statement interface is a public abstract interface. It is the object that is used to execute a static SQL statement and obtain the results of the execution.
The JDBC Driver allows for the creation of a Statement object that generates ResultSet objects with the given type and concurrency. This differs from the CreateStatement method in JDBC 1.0 because it allows the default result set type and result set concurrency type to be overridden.
Subinterfaces:
CallableStatement
PreparedStatement
The following table lists the differences from the standard Statement interface defined in the JDBC API.
 
Method name
Notes
getFetchSize()
No operation in the solidDB JDBC API.
getMaxFieldSize()
Maxfield size does not affect the server behavior.
getMoreResults()
The server does not support multiple result sets.
getResultSetType()
Not supported.
setFetchSize(int rows)
No operation in the solidDB JDBC API.
Sets the value for the number of rows to be fetched from the database each time. The value a user sets with this method is ignored.
setMaxFieldSize(int max)
Maxfield size does not affect the server behavior.
Struct
The java.sql.Struct interface is not supported. This interface represents the standard mapping in the Java programming language for an SQL structured type. It reflects the SQL-99 standard that is unavailable in the solidDB JDBC API.
ResultSet (updateable)
The java.sql.Resultset interface contains methods for producing ResultSet objects that are updateable. A result set is updateable if its concurrency type is CONCUR_UPDATABLE. Rows in the result set can be updated, deleted, or new rows can be inserted using methods update xxx, where xxx means the data type and methods updateRow and deleteRow.
The following table lists the differences from the standard ResultSet interface that is defined in the JDBC API.
 
Method name
Notes
getRef(int i)
This method is not supported.
getRef(String colName)
This method is not supported.
refreshRow()
This method is not supported.
rowDeleted()
This method is not supported.
rowInserted()
This method is not supported.
setFetchSize(int rows)
This method is not supported.
Go up to
solidDB JDBC driver