Info Requirements Introduction 1,2,3-Tier Solutions Further Informations ... Copyrights Classes Classes of the ODBC interface class J2ODBC constants constructors allocConnect() allocEnv() allocStmt() bindCol() browseConnect() cancel() clone() collAttributes...() columns() connect() describeCol...() describeParam...() disconnect() driverConnect() error() execDirect() execute() extendedFetch() fetch() foreignKeys() freeConnect() freeEnv() freeStmt() getConnectOption...() getCursorName() getData...() getInfoNum(), getInfoStr() getStmtOption...() getTypeInfo() moreResults() nativeSql() numParams() numResultCols() paramData() paramOptions...() prepare() primaryKeys() procedures() procedureColumns() putData() rowCount() setConnectOption...() setCursorName() setParam() setPos() setScrollOptions() setStmtOption...() specialColumns() statistics() tablePrivileges() tables() transact() class J2ODBCException constructors class J2ODBCWarning constructors Classes of the JDBC interface Class JdbcOdbcCallableStatement constructors get...() registerOutParameter() wasNull() Class JdbcOdbcConnection definitions constructors destructors clearWarnings() close() commit() createStatement() getAutoClose() getAutoCommit() getCatalog() getMetaData() getTransactionIsolation() getWarnings() isClosed() isReadOnly() nativeSql() prepareCall() prepareStatement() queryOdbcBridge() rollback() setAutoClose() setAutoCommit() setCatalog() setReadOnly() setTransactionIsolation() Class JdbcOdbcDatabaseMetaData Class JdbcOdbcDriver constructors acceptsURL() connect() getMajorVersion() getMinorVersion() getPropertyInfo() jdbcCompliant() Class JdbcOdbcPreparedStatement constructors clearParameter() execute() executeQuery() executeUpdate() set...() setNull() setObject() setAsciiStream() setBinaryStream() setUnicodeStream() Class JdbcOdbcResultSet constructors clearWarnings() close() findColumn() get...() getAsciiStream() getBinaryStream() getCursorName() getMetaData() getObject() getUnicodeStream() getWarnings() next() wasNull() Class JdbcOdbcResultSetMetaData definitions constructors getCatalogName() getColumnCount() getColumnDisplaySize() getColumnLabel() getColumnName() getColumnType() getColumnTypeName() getPrecision() getScale() getSchemaName() getTableName() isAutoIncrement() isCurrency() isCaseSensitive() isDefinitelyWritable() isNullable() isReadOnly() isSearchAble() isSigned() isWritable() Class JdbcOdbcStatement constructors cancel() clearWarnings() close() execute() executeQuery() executeUpdate() getCursorName() getMaxFieldSize() getMaxRows() getMoreResultSet() getQueryTimeout() getResultSet() getWarnings() getUpdateCount() setCursorName() setEscapeProcessing() setMaxFieldSize() setMaxRows() setQueryTimeout() Examples Example #1 Example #2 History Author's Details Archive Location
JDBC-ODBC bridge for OS/2 * database access under Java * |
All programs included in this package are provided "as is", without any warranty! Try them on your own risk. |
(c) 1996 by Dirk Ohme - all rights reserved
Note: In order to do something useful, you need the following:
Java, Sun's progressive new platform-independent language, is a
first-level choice of todays software development. Because of its strength -
to be platform independent - it fits the needs for having software on various
(different) hardware.
But a programming language is one thing - another the access to the
peripherie, especially the access to data storages, as represented by SQL
databases. In order to prevent proprietary solutions, Sunsoft, a daughter firm
of Sun Systems, set up a standard for database access, called JDBC -
Java DataBase Connection. This API is based on experiences of
previous solutions for other languages and systems - mainly X/Open's SQL
Call-Level Interface (CLI) and Microsoft's Open DataBase
Connectivity (ODBC)..
The main idea is as follows:
One may say, that using a JDBC-ODBC bridge reduces performance
of a Java application. Sure, each call-translation cost time. On the other
hand, there are not enough native Java JDBC drivers available, yet. A lot of
database vendors don't develop or haven't developed yet JDBC drivers. So for
many databases taking the ODBC driver is the only chance to get in connection
with the data.
Speaking of Java DataBase Connection means speaking of connecting
two different worlds. Most databases are written in an other language than
Java, so interactions have to go across a border set up by the system(s).
To build the bridge between application and database, there are several
solutions depending the database system:
For the moment, this JDBC-ODBC bridge is a 2-tier solution, so
the Java applications needs its dynamic library on the same machine.
A 3-tier solution may be available at a later time ...
For further informations have a look on the following links and
references:
The Java(tm) technology is owned and exclusively licensed by
Sun Microsystems Inc.. Java is a trademark of Sun Microsystems Inc. in
the U.S. and other countries.
This chapter and the chapters below describe the Java classes available
with the JDBC-ODBC bridge.
The implementation of the JDBC-ODBC bridge consists of a layer of several
classes. As mentioned before, the application communicates with an abstraction
class, the JDBC driver manager. This one returns for each connection
a proper link to a JDBC driver. When performing database interactions, a SQL
statement has to be prepared, sent and a result gathered. For each task a
Java class is set up.
On this JDBC-ODBC bridge, there is another class J2ODBC
implemented, which connects the JDBC part with the ODBC driver manager. As
shown in the diagram, the various JDBC classes use the same J2ODBC class for
interactions through the ODBC.
This section describes the classes and methods of the ODBC interface.
Classes
Exceptions
Warnings
This class is implemented as package iODBC.sql.dll. Therefore an
import should reference iODBC.sql.dll.J2ODBC (and
iODBC.sql.dll.J2ODBCException
for exception handling, too).
The class requires an external link library,
Global definitions:
SQL data types:
The first constructor creates a new, fresh object. The second can be used
to create an object connected to a current object connected to a ODBC source.
But instead of the cloning (as done by
clone()), this constructor
leaves the statement handle uninitialized.
Note: Allocates a new connection handle. Must be called after
allocEnv() in order to
establish a connection via
connect().
To free a connection handle, use the
freeEnv() method.
Allocates a new environment for ODBC activities. Must be called before any
other ODBC routine. To free the environment, use
freeEnv().
Before a SQL statement could be
prepared or
executed, a statement handle
has to be obtained from the ODBC driver. This method provides an access to
a new statement handle. In order to release the obtained handle, the
freeStmt() method should be
called.
Note: not implemented yet!
Browse connStr and return a connection string.
Cancels a long-time SQL statement/transaction.
Returns a clone of the current object, i.e. a new object, pointing to the
same ODBC data source with a copy of the current statement handle.
Note: Returns the value for a specified attribute fDescType for a
column (1 <= colIndex
<= numResultCols()).
For string results, colAttributesString() returns the result;
for numerical results, colAttributesValue() returns the result.
Possible values for fDescType are:
Possible returns for COLUMN_UPDATABLE:
Possible returns for COLUMN_SEARCHABLE:
Returns the columns matching the conditions in a result set, like a query
does. Before this method can be called, a statement handle has to be
obtained. The parameter
tableQualifier, if set, reduces the resulting list to those tables,
which are mapped to the specified qualifier (catalogue). The same do
tableOwner for the owner of tables, tableName for table
names and columnName for the name of columns. Setting a parameter
null disables this search criteria and returns all data (matching
the other criterias).
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
Note: Connects to a given ODBC data source dsn using the user name
uid and password pwd. This call has to be executed before
any database interactions. Previously the environment and the database context
have to be initialized (see
allocEnv and
allocConnect).
In order to withdraw from a database, use
disconnect().
The describeCol() method gets the information about a column
colIndex of a result set of a query, which can be gathered by the
other methods:
The describeParam() method gets the information about parameter
no. colIndex of a SQL
preparedstatement, which
can be gathered by the other methods:
Closes a connection opened by a
connect() or
driverConnect() call.
Like connect() this
routine allows connection to a ODBC data source. But unlike the other routine,
a connection string (connStr) has to be defined, which consists of
these entries:
The entries are separated by colons (;). Further, a flag
fDrvCmpl can be specified, which tells the ODBC driver whether and
how to prompt (login dialog window) for missing data necessary during login,
or not. The available flags are:
In order to withdraw from a database, use
disconnect().
Returns a string representation for a previously occurred database or ODBC
error.
Prepares and then executes a given SQL statement sqlStmt.
On DELETE, INSERT or UPDATE
rowCount() returns the
number of rows affected, on queries
numResultCols()
returns the number of columns in the result set (see
fetch()).
Executes a previously
prepared SQL statement.
On DELETE, INSERT or UPDATE
rowCount() returns the
number of rows affected, on queries
numResultCols()
returns the number of columns in the result set (see
fetch()).
Not implemented yet!
See fetch() instead.
Loads the first/next row of the result set of a query so it can be accessed
by getData...() calls.
Returns the foreign-primary key relation on tables matching the conditions
in a result set, like a query does. Before this method can be called, a
statement handle has to be
obtained.
pkTableQualifier specifies a search criteria on qualifiers
(catalogues) of primary keys, fkTableQualifier on qualifiers of
foreign keys of tables. pkTableOwner (fkTableOwner)
defines a search criteria on owners of primary keys (foreign keys),
pkTableName (fkTableName) a criteria on table names with
primary (foreign) keys. Setting a parameter null disables this
search criteria and returns all data (matching the other criterias).
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
Note: Frees a database context allocated by
allocConnect(). This
can only be done, if all previous transactions have been completed (see
transact()). Afterwards
the environment can be freed via the
freeEnv() routine.
Frees an environment allocated by
allocEnv(). Freeing the
environment is the last step after all database interactions, in order to
terminate properly. Previous, all database contexts have to be freed by
freeConnect() calls.
Frees or manipulates a statement handle allocated by the
allocStmt() method.
fOption may be one of this:
Returns informations about a connection. fOption specifies the
type of information to be returned:
Options possible for ACCESS_MODE:
Options possible for AUTOCOMMIT:
Options possible for ODBC_CURSORS:
Options possible for OPT_TRACE:
Returns the name of the cursor associated with the currently processed
statement.
Returns the contents of a column (with 1 <= colIndex
<= numResultCols())
in the requested data type.
getDataDate() is not implemented yet!
getDataCheckForNull() returns true if the last column
requested contains a SQL NULL value.
Before the first access to a column of the resulting set and before the
access to the next row, a
fetch() call has to be done.
These calls can be used to retrieve informations about the ODBC sub-system.
Because some informations are represented by number, some by strings, there are
two methods for accessing them. The following list shows the possible
request flags (fInfoType):
Options for CURSOR_COMMIT_BEHAVIOUR and
CURSOR_ROLLBACK_BEHAVIOUR:
Options for DEFAULT_TXN_ISOLATION and
TXN_ISOLATION_OPTION:
Returns informations about a statement handle. Possible values for
fOption are:
Possible values for CONCURRENCY:
Returns a result set (like a query does), describing details about the
given SQL data type (fSqlType). See
'constants' for a
description of valid SQL data types.
Checks for further result sets and initializes them.
Translates a given SQL statement sqlStmt, containing database
specific extensions, into a native SQL statement.
Returns the number of parameter markers set in a SQL statement, which has
been prepared.
Returns the number of columns available in a result set of a query. This
method may be called after a
prepare() or a
execDirect() call.
not implemented yet!
Allows the setting of various parameter arrays in combination with
setParam().
numOfParams specifies, how many entries in the array exists for one
parameter. The result of the paramOptions()-call can be gathered
by the paramOptionsResultNumber-routine, which returns the number of
array indices successfully processed.
Before execution of a SQL statement (sqlStmt) it has to be
prepared. This method causes the SQL engine to prepare the given statement for
execution, that can be then done by the
execute() method.
Another way for direct execution is the
execDirect() method,
which combines preparation and execution state.
Returns the primary keys of tables matching the conditions in a result set,
like a query does. Before this method can be called, a statement handle has to
be obtained. The parameter
tableQualifier, if set, reduces the resulting list to those tables,
which are mapped to the specified qualifier (catalogue). The same do
tableOwner for the owner of tables and tableName for
table names. Setting a parameter null disables this search criteria
and returns all data (matching the other criterias).
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
Note: This method returns names and other data of stored database procedures in
a result set, like a query does. procQualifier specifies a search
criteria on qualifiers (catalogues), procOwner on owners of such
procedures, and procName on procedure names. Setting a parameter
null disables this search criteria and returns all data (matching
the other criterias).
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
Note: This method returns data about parameters of stored database procedures in
a result set, like a query does. procQualifier specifies a search
criteria on qualifiers (catalogues), procOwner on owners of such
procedures, procName on procedure names, and columnName
on column (i.e. parameters). Setting a parameter null disables this
search criteria and returns all data (matching the other criterias).
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
Note: not implemented yet!
Returns the number of rows affected by an DELETE,
INSERT or UPDATE statement executed via
execute() or
execDirect().
Sets options on a connection. fOption specifies the
type of option to be set, which is done by the paramValue or
paramStr parameter. Possible values for fOption
are:
Options possible for ACCESS_MODE:
Options possible for AUTOCOMMIT:
Options possible for ODBC_CURSORS:
Options possible for OPT_TRACE:
Sets the name of the cursor associated with the currently processed
statement to cursorName
not implemented yet!
Sets a cursor to a specific row rowIndex in the result set.
Boolean values describe whether to update the result set (fRefresh)
and/or to lock the result set (fLock), or not.
Possible values for CONCURRENCY:
Returns special columns (like primary keys or indices) of tables matching
the conditions in a result set, like a query does. Before this method can be
called, a statement handle has to be
obtained.
fColType is one of these:
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
The parameter fScope specifies the duration, on which a
ROWID value identifying a single row is valid:
Note: Returns statistics about one or more tables matching the search criterias
in a result set, like a query does. Before this method can be called, a
statement handle has to be
obtained. The parameter
tableQualifier, if set, reduces the resulting list to those tables,
which are mapped to the specified qualifier (catalogue). The same do
tableOwner for the owner of tables and tableName for
table names. Setting a parameter null disables this search criteria
and returns all data (matching the other criterias). The parameter
fUnique (if set TRUE) prevents redundancies in data about indices,
the parameter fAccuracy (if set TRUE) ensures data returned to be
stable - under some conditions setting this may be necessary to prevent
inaccurate data.
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
Note: Returns privileges on tables matching the conditions in a result set, like
a query does. Before this method can be called, a statement handle has to be
obtained. The parameter
tableQualifier, if set, reduces the resulting list to those tables,
which are mapped to the specified qualifier (catalogue). The same do
tableOwner for the owner of tables and tableName for
table names. Setting a parameter null disables this search criteria
and returns all data (matching the other criterias).
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
Note: Returns the tables matching the conditions in a result set, like a query
does. Before this method can be called, a statement handle has to be
obtained. The parameter
tableQualifier, if set, reduces the resulting list to those tables,
which are mapped to the specified qualifier (catalogue). The same do
tableOwner for the owner of tables, tableName for table
names and tableType for the type of table (i.e. views, real tables,
aliases, synonyms, etc.). Setting a parameter null disables this
search criteria and returns all data (matching the other criterias).
In some string parameters a so-called joker ('%') may occur. It stands for
a variable-sized string of variable characters.
Note: Terminates all previous database transactions be validating
(fType = COMMIT) or invalidating (ROLLBACK)
them.
The exception class used within class
iODBC.sql.dll.J2ODBC.
The first constructor may be used to create an empty exception, the second
sets a exception containing the specified message. The third may be used to
specify a certain SQL state and the last even to specify a vendor specific
code.
The warning class used within class
iODBC.sql.dll.J2ODBC.
The first constructor may be used to create an empty exception, the second
sets a exception containing the specified message. The third may be used to
specify a certain SQL state and the last even to specify a vendor specific
code.
This chapter and all chapters below describe the Java classes available
with the JDBC interface.
Classes
Exceptions
This class provides access to SQL stored procedures. There are two different
syntax schemes for functions and procedures:
The first scheme provides a result paramater, which has to be registered as
an OUT parameter (see below). All parameters are refered
sequentially by index numbers, starting with 1.
So-called IN parameters, that are parameters filled before
running the stored procedure, have to be set using the
JdbcOdbcPreparedStatement::set...()
methods. So-called OUT parameters, that are parameters filled by
the stored procedure, have to be registers before execution of the stored
procedure using
registerOutParameter().
Afterwards, the results may be queried by the
get...() methods.
Callable statements may return zero, one or more result sets (see
JdbcOdbcResultSet).
Used by
JdbcOdbcConnection::prepareCall()
to create a new object. dbConnection refers to the current database
connection, which uses the odbcObj ODBC interface. The call for the
SQL stored procedure is given in sql.
Returns the contents of the parameter with index number
parameterIndex (starting with 1) in the appropriate format. The
following table shows which methods matches SQL data types very closely - on
some databases it may be possible to specify a completely other SQL data type
for a column/parameter, like CHAR for BIT.
Note: Registers an OUT parameter in a call for a SQL stored procedure.
parameterIndex contains the index number (starting with 1) of the
parameter, sqlType the SQL data type (see java.sql.Type
for details) and the additional parameter scale a scaling factor.
Returns true if the last parameter queried by a
get...() method was NULL.
In order to perform database interactions, a connection has to be
established. This class is the main part on database interactions. From within
there could be statements prepared and executed, and result sets gathered.
The following definitions are available for
getTransactionIsolation() and
setTransactionIsolation():
Used by the
JdbcOdbcDriver class to perform a
database login on database source db, using user name
user and password passwd.
On garbage collection this method is used to close the database connection.
See close(), too.
Clears the last warning occurred from the message queue. See
getWarnings(), too.
In order to close a connection directly without waiting for the garbage
collection, this method may be called. After successful termination, no
further actions can be done by this object - the next step should be the
invalidation of the object reference (setting the variable null).
Validates all previous transactions, i.e. all changes done are saved. See
rollback(), too.
Get a new object, which can obtain a SQL statement. See the
JdbcOdbcStatement class for more
details.
Returns the state of the 'automatic close of cursors on termination'
mechanism. See
setAutoClose(), too.
Returns the state of the AUTOCOMMIT feature. See
setAutoCommit(), too.
Returns the catalogue name used in the transactions. This is normally the
name of the database or data source used during login. See
setCatalog(), too.
Returns an object which can be used to examine the database. See
JdbcOdbcDatabaseMetaData for details.
Returns the current transaction isolation level. The result may be one of
these constants:
Returns the last warning occurred. See
clearWarnings(), too.
Returns true if no connection exists.
Returns the state of a connection - true, if the connection is
set read-only. See
setReadOnly(), too.
A SQL statement (sql) may contain JDBC or ODBC specific escape
sequences. This method provides a function for resolving such escape sequences.
It returns native SQL syntax.
Get a new object, which obtains a SQL stored procedure call. The call
sequence is set by the sql parameter. See the
JdbcOdbcCallableStatement class for more
details.
Get a new object, which obtains a prepared SQL statement, formed by the
SQL statement sql. See the
JdbcOdbcPreparedStatement class for more
details.
Returns the handle to the
J2ODBC class, which is used for
accessing the ODBC driver manager.
Invalidates all previous transactions, i.e. all changes done are withdrawn.
See commit(), too.
Enables or disables (autoClose equals true or
false) the automatic close of cursors on termination.
See getAutoClose(), too.
Enables or disables (depending on autoCommit) the
AUTOCOMMIT feature provided with many databases. If enabled, on
exit a database COMMIT is executed automatically. See
getAutoCommit(), too.
Sets a new catalogue catalog for all following transactions. See
getCatalog(), too.
Note: Switches a connection to read-only, if readOnly is set
true. See
isReadOnly(), too.
Sets a new transaction isolation level. For level, these
definitions are
valid:
not implemented yet!
This class implements the base on which the other classes of the JDBC-ODBC
bridge refer to. In order to access the JDBC-ODBC bridge, the JDBC driver
manager has to be notified to use it. One way is to do so is to create an
empty object of this class:
Registers the JDBC-ODBC bridge at the JDBC driver manager. A following
DriverManager::getConnection() call may then return
an object to the bridge.
Returns true if the given uniform resource locator url
can be resolved by this driver. On the JDBC-ODBC bridge such URLs has to
start with jdbc:odbc: or
jdbc:iodbc: in order to be resolved.
This method is normally called by the JDBC driver manager in order to
perform a login to a given database or data source. url is a
string identifying the data source; it is of the form
jdbc:type:sub_type.
Note: info is a list of properties necessary during login. Currently
the following properties are used:
Returns the major version number of the driver.
Returns the minor version number of the driver.
Returns a list of required properties necessary for database login for the
given url and property list info.
Returns whether the driver is JDBC compliant or not. A result value of
true reflects that the driver has been proved for
Whenever there is the need to pre-compile a SQL statement, this class may
be used. It allows to set the IN parameters on such statements, i.e.
such statement may contain placeholders which are filled after pre-compilation
but before execution. See set...()
for details.
Normally called by the
JdbcOdbcConnection::prepareStatement()
method. dbConnection reflects the current database connection
object, odbcObj the current ODBC interface object, and
sql the SQL statement to be prepared.
Resets all parameters.
Executes the prepared statement. If one or more
result set(s) is/are available, a
true value is returned.
Executes the prepared statement and returns a
result set.
Note: Sets an IN parameter with index number parameterIndex
(starting with 1) to NULL. The data type for the IN
parameter must be specified by sqlType - see
Java.sql.Types for details.
Sets a IN parameter with index number parameterIndex
(starting with 1) to x. targetSqlType specifies the
target SQL data type (see Java.sql.Types), scale is an
optional scaling factor.
Note: On large data (SQL LONGVARCHAR) this method ables to send the parameter
data by a stream. parameterIndex (starting with 1) specifies the
parameter (by index number), which has to be set. x refers to
the stream which sends the data. In length the number of bytes
available in the stream is set.
Note: On large data (SQL LONGVARBINARY) this method ables to send the parameter
data by a stream. parameterIndex (starting with 1) specifies the
parameter (by index number), which has to be set. x refers to
the stream which sends the data. In length the number of bytes
available in the stream is set.
Note: On large data (SQL LONGVARCHAR) this method ables to send the parameter
data by a stream. parameterIndex (starting with 1) specifies the
parameter (by index number), which has to be set. x refers to
the stream which sends the data. In length the number of bytes
available in the stream is set.
Note: Every time a SQL statement executed provides results, this class is used
to provide an access to that data. There is a cursor, initiated to the begin
(some may say: the first row) of the resulting data. The first (next)
row of that data is accessed by using the
next() method, columns of the row
may be gathered using the
get...() methods.
Used by the various execute...() methods in the classes
newDb is a reference to the currently ODBC interface used.
Clear warnings in chain list.
Closes the cursor associated with the result set. There is then no longer
access to the results.
On large data (SQL LONGVARCHAR) this method ables to receive the result
data by a stream. columnIndex (starting with 1) specifies the
parameter (by index number), which will be returned. Same does
columnName for the other method.
Note: On large data (SQL LONGVARBINARY) this method ables to receive the result
data by a stream. columnIndex (starting with 1) specifies the
parameter (by index number), which will be returned. Same does
columnName for the other method.
Note: Returns the name of the cursor associated with the result set.
Returns an object to a
JdbcOdbcResultSetMetaData class. This
object can be used to get further informations about a result set.
Returns the contents of the parameter with index number
columnIndex (starting with 1) or with column name
columnName as object. The type of the object depends on the SQL
data type of the column in the result row or on the SQL type value
targetSqlType (see Java.sql.Types). The additional
parameter scale may specify a scaling factor.
On large data (SQL LONGVARCHAR) this method ables to receive the result
data by a stream. columnIndex (starting with 1) specifies the
parameter (by index number), which will be returned. Same does
columnName for the other method.
Note: Returns the next warning message stored in the chain, which has been caused
by this class.
In order to get the first/next row of a result set, this method has to be
called.
Returns whether the last access
(see get...()) to a column of a
result row refered to a NULL value or not.
A object of this class provides informations about types and properties of
columns of the result set.
The following definitions are used at the
isNullable() method:
Called by the
JdbcOdbcResultSet::getMetaData()
method in order to create a new result set meta data object.
Returns the name of the catalog containing the table with the specified
column (1 <= columnIndex
<= getColumnCount()).
Returns the number of columns available in the result set.
Returns the maximum width in display of the specified column
(1 <= columnIndex <=
getColumnCount()).
Returns the suggested column label of the specified column
(1 <= columnIndex <=
getColumnCount()).
Returns the name of the specified column (1 <= columnIndex <=
getColumnCount()).
Returns the JDBC data type of the specified column
(1 <= columnIndex
<= getColumnCount()).
See Java.sql.Types for a description of these types.
Returns the name of the JDBC data type of the specified column
(1 <= columnIndex
<= getColumnCount()).
See Java.sql.Types for a description of these types.
Returns the precision of the specified column (1 <= columnIndex
<= getColumnCount()).
Returns the scale of the specified column (1 <= columnIndex
<= getColumnCount()).
Returns the schema name of the table containing the specified column
(1 <= columnIndex <=
getColumnCount()).
Returns the name of the table containing the specified column
(1 <= columnIndex
<= getColumnCount()).
Returns true if the specified column (1 <= columnIndex
<= getColumnCount())
increments automatically on an INSERT or not.
Note: Returns true if the specified column (1 <= columnIndex
<= getColumnCount())
represents a cash value.
Returns true if the specified column (1 <= columnIndex
<= getColumnCount())
is case-sensitive. Normally character based columns are case-sensitive.
Returns true if the specified column (1 <= columnIndex
<= getColumnCount())
can be modified. This method assures the writability of a column.
Returns whether if the specified column (1 <= columnIndex
<= getColumnCount())
can contain NULL values or not:
Returns true if the specified column (1 <= columnIndex
<= getColumnCount())
is read-only and may not be modified.
Returns true if the specified column (1 <= columnIndex
<= getColumnCount())
may be included in a WHERE clause of a SQL statement.
Returns true if the specified column (1 <= columnIndex
<= getColumnCount())
contains signed values. Normally, only numerical data columns can contain
signed values.
Returns true if the specified column (1 <= columnIndex
<= getColumnCount())
may be modified.
The purpose of this class is the representation of a SQL statement in Java.
A statement object saves and executes a SQL statement, and then represents a
result set (see class ResultSet).
Note: Called by the
JdbcOdbcConnection::createStatement()
method in order to create a new statement object.
Cancels the current execution of a SQL statement. This may only take effect,
when there is a multi-threading environment.
Clears the last warning occurred from the message queue. See
getWarnings(), too.
After a
executeQuery(),
executeUpdate() or
execute() call, this method
should be used in order to free the object and all associated data.
Sends the given SQL statement sql to the database server and
returns, whether there is a result set (true) or not
(false). The result set may be queried then by the
getResultSet() method.
Sends the given SQL statement sql to the database server and
returns a result set.
Note: Sends the given SQL statement sql to the database server. The
number returned reflects the number of rows being affected.
Note: Returns the name of the cursor currently associated with this statement
object. The
setCursorName() method
allows setting of cursor names.
Returns the maximum amount of data, returned for any column value of a SQL
data type like
Returns the maximum numbers of rows, a result set may return. The
setMaxRows() method can be
used to manipulate this number.
If there is more than one result set, this method may be used to address the
next one. It closes the current result set and prepares the next one for access
via getResultSet().
A return code that equals true reflects, that there is another
result set, while false is returned when there is no more result
set.
Returns the time (in seconds) the driver will wait on a statement to be
executed, before raising a timeout exception. A new timeout value may be set
using the
setQueryTimeout()
method.
When
execute() returns
true, this method provides access to the result set.
Returns the last warning occurred. See
clearWarnings(), too.
The number affected by a DELETE, INSERT or
UPDATE command (see
execute() or
executeUpdate()) can be
gathered using this method.
Defines the name of the SQL cursor associated with the next execution of
a SQL statement. The name will be set to name. The current name of
the cursor may be queried by
getCursorName().
If enabled (enable == true) escape sequences in SQL
statements will be processed (this is the default). If disabled, there is no
extra processing on such sequences.
Sets the limit (in bytes) to the value of max on columns of the
SQL data types
Sets the maximum number of rows returned by a result set to
All files of the JDBC-ODBC bridge are copyrighted by Dirk Ohme. You are allowed
to use them and all related stuff in non-commerical environments without any
fee. If you want to use them within a commerical environment, please contact
the author. The archive may be distributed freely, but only as one package that
mustn't be modified to the original distribution!
Requirements
Introduction
1,2,3-Tier Solutions
Further Informations ...
Copyrights
Classes
Classes of the ODBC interface
class J2ODBC
constants
constructors
public J2ODBC();
public J2ODBC( J2ODBC currConnection );
By constructing a new object using an already open connection keep in mind,
that there is only one connection path. So on exit, only one
object must close the handles!
allocConnect()
public native void allocConnect() throws Exception;
allocEnv()
public native void allocEnv() throws Exception;
allocStmt()
public native void allocStmt() throws Exception;
In this implementation, each object of the class J2ODBC can obtain only one
statement handle. If there is the need to have more than one handle open, a
new object has to be created using the
J2ODBC( currConnection )
constructor.
bindCol()
// public native void bindCol();
browseConnect()
public native String browseConnect( String connStr ) throws Exception;
cancel()
public native void cancel() throws Exception;
clone()
public Object clone();
By constructing a new object using an already open connection keep in mind,
that there is only one connection path. So on exit, only one
object must close the handles!
collAttributes...()
public native void colAttributes( int colIndex,
int fDescType ) throws Exception;
public String colAttributesString() { return attrDesc; }
public int colAttributesValue() { return attrValue; }
name STR VAL description
COLUMN_AUTO_INCREMENT * boolean value, TRUE = column
value automatically increments on insertion (auto primary key)
COLUMN_CASE_SENSITIVE * boolean value, TRUE = column
contains case-sensitive data (like characters)
COLUMN_CATALOG_NAME * name of the catalog containing
the table
COLUMN_COUNT * number of resulting columns
(colIndex is unused)
COLUMN_DISPLAY_SIZE * size need for display data
(characters)
COLUMN_LABEL * label of the column name, or,
if un-labeled, the column name
COLUMN_LENGTH * length of column in characters
COLUMN_MONEY * boolean value, TRUE = column
represent a currency
COLUMN_NAME * name of the column in result set
COLUMN_NULLABLE * boolean value, TRUE = column can
be set NULL
COLUMN_OWNER_NAME * name of the table owner
COLUMN_PRECISION * precision (on number columns)
COLUMN_QUALIFIER_NAME * name of the database containing
the table
COLUMN_SCALE * scaling (on number columns)
COLUMN_SCHEMA_NAME * name of the schema containing the
table
COLUMN_SEARCHABLE * (see below)
COLUMN_TABLE_NAME * name of the database table
containing the column specified
COLUMN_TYPE * SQL data type, see
'constants' for possible
values
COLUMN_TYPE_NAME * name of the SQL data type used
in that column
COLUMN_UNSIGNED * boolean value, TRUE = column
contains unsigned data (number)
COLUMN_UPDATABLE * (see below)
columns()
public native void columns( String tableQualifier,
String tableOwner,
String tableName,
String columnName ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
connect()
public native void connect( String dsn,
String uid,
String pwd ) throws Exception;
describeCol...()
public native void describeCol( int colIndex ) throws Exception;
public String describeColName() { return colName; }
public int describeColType() { return colSqlType; }
public int describeColPrecision() { return colPrecision; }
public int describeColScale() { return colScale; }
public boolean describeColNullable() { return colNullable; }
describeParam...()
public native void describeParam( int paramIndex ) throws Exception;
public int describeParamType() { return colSqlType; }
public int describeParamPrecision() { return colPrecision; }
public int describeParamScale() { return colScale; }
public boolean describeParamNullable() { return colNullable; }
disconnect()
public native void disconnect() throws Exception;
driverConnect()
public native String driverConnect( String connStr,
int fDrvCmpl ) throws Exception;
error()
public native String error() throws Exception;
execDirect()
public native void execDirect( String sqlStmt ) throws Exception;
execute()
public native void execute() throws Exception;
extendedFetch()
// public native boolean extendedFetch();
fetch()
public native boolean fetch() throws Exception;
foreignKeys()
public native void foreignKeys( String pkTableQualifier,
String pkTableOwner,
String pkTableName,
String fkTableQualifier,
String fkTableOwner,
String fkTableName ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
freeConnect()
public native void freeConnect() throws Exception;
freeEnv()
public native void freeEnv() throws Exception;
freeStmt()
public native void freeStmt( int fOption ) throws Exception;
getConnectOption...()
public native int getConnectOptionNum( int fOption ) throws Exception;
public native String getConnectOptionStr( int fOption ) throws Exception;
name NUM STR description
ACCESS_MODE * access mode to database source,
see below
AUTOCOMMIT * automatical COMMIT on the end
of a session, see below
CURRENT_QUALIFIER * current qualifier name
LOGIN_TIMEOUT * timeout value on login,
LOGIN_TIMEOUT_DEFAULT specifies the default setting
ODBC_CURSORS * type of cursors, see below
OPT_TRACE * trace mode setting, see below
OPT_TRACEFILE * name of the trace file, when
tracing is enabled - OPT_TRACE_FILE_DEFAULT specifies the default file name
QUIET_MODE * application window handle under
which dialog boxes are placed as childs
PACKET_SIZE * transfer packets size
TRANSLATE_DLL * name of the translation DLL
TRANSLATE_OPTION * translation option
TXN_ISOLATION * transaction isolation level,
TRUE, if transactions are isolated
getCursorName()
public native String getCursorName() throws Exception;
getData...()
public boolean getDataCheckForNull() { return colIsNull; }
public native boolean getDataBoolean( int colIndex ) throws Exception;
// public native Date getDataDate( int colIndex ) throws Exception;
public native double getDataDouble( int colIndex ) throws Exception;
public native float getDataFloat( int colIndex ) throws Exception;
public native int getDataInteger( int colIndex ) throws Exception;
public native String getDataString( int colIndex ) throws Exception;
getInfoNum(), getInfoStr()
public native int getInfoNum( int fInfoType ) throws Exception;
public native String getInfoStr( int fInfoType ) throws Exception;
name NUM STR description
CURSOR_COMMIT_BEHAVIOR * describes the reaction of open
cursors to COMMIT (see below).
CURSOR_ROLLBACK_BEHAVIOR * describes the reaction of open
cursors to ROLLBACK (see below).
DEFAULT_TXN_ISOLATION * returns a mask describing the
default transaction isolation level (see below).
DRIVER_HDBC * returns the currently used
database context handle
DRIVER_HENV * returns the currently used
environment handle
DRIVER_HLIB * returns the currently used
library handle
DRIVER_HSTMT * returns the currently used
statement handle
DRIVER_NAME * returns the name of the ODBC
driver used
DRIVER_ODBC_VER * returns the version of the ODBC
driver as string (like '2.1')
NON_NULLABLE_COLUMNS * returns in a boolean value
whether table columns can be set equal NULL or not.
ODBC_VER * returns the version string for
the ODBC driver (like '02.01')
QUALIFIER_LOCATION * returns the location of the
qualifier in a qualified table name
TXN_ISOLATION_OPTION * returns the transaction
isolation levels available at the current connection (see below).
getStmtOption...()
public native int getStmtOptionNum( int fOption ) throws Exception;
public native String getStmtOptionStr( int fOption ) throws Exception;
name Num Str description
ASYNC_ENABLE * returns TRUE when SQL statements
are executed asynchronously
BIND_TYPE * returns the binding type
CONCURRENCY * returns cursor concurrencies,
see below.
CURSOR_TYPE * returns the cursor type on the
statement handle
GET_BOOKMARK not supported!
KEYSET_SIZE * returns the size of the key set
MAX_LENGTH * 0 or the maximum length of a
result column of a query
MAX_ROWS * returns the maximum number of
rows produced by the last query executed
NOSCAN * returns TRUE if there is no scan
for escape sequences in SQL statements
QUERY_TIMEOUT * returns the timeout value on
queries
RETRIEVE_DATA not supported!
ROW_NUMBER not supported!
ROWSET_SIZE * returns the size of the row set
SIMULATE_CURSOR not supported!
USE_BOOKMARKS not supported!
getTypeInfo()
public native void getTypeInfo( int fSqlType ) throws Exception;
moreResults()
public native boolean moreResults() throws Exception;
nativeSql()
public native String nativeSql( String sqlStmt ) throws Exception;
numParams()
public native int numParams() throws Exception;
numResultCols()
public native int numResultCols() throws Exception;
paramData()
// public native void paramData();
paramOptions...()
public native void paramOptions( int numOfParams ) throws Exception;
public int paramOptionsResultNumber() { return paramResultNumber; }
prepare()
public native void prepare( String sqlStmt ) throws Exception;
primaryKeys()
public native void primaryKeys( String tableQualifier,
String tableOwner,
String tableName ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
procedures()
public native void procedures( String procQualifier,
String procOwner,
String procName ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
procedureColumns()
public native void procedureColumns( String procQualifier,
String procOwner,
String procName,
String columnName ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
putData()
// public native void putData();
rowCount()
public native int rowCount() throws Exception;
setConnectOption...()
public native void setConnectOptionNum( int fOption,
int paramValue ) throws Exception;
public native void setConnectOptionStr( int fOption,
String paramStr ) throws Exception;
name NUM STR description
ACCESS_MODE * access mode to database source,
see below
AUTOCOMMIT * automatical COMMIT on the end
of a session, see below
CURRENT_QUALIFIER * current qualifier name
LOGIN_TIMEOUT * timeout value on login,
LOGIN_TIMEOUT_DEFAULT specifies the default setting
ODBC_CURSORS * type of cursors, see below
OPT_TRACE * trace mode setting, see below
OPT_TRACEFILE * name of the trace file, when
tracing is enabled - OPT_TRACE_FILE_DEFAULT specifies the default file name
QUIET_MODE * application window handle under
which dialog boxes are placed as childs
PACKET_SIZE * transfer packets size
TRANSLATE_DLL * name of the translation DLL
TRANSLATE_OPTION * translation option
TXN_ISOLATION * transaction isolation level,
TRUE, if transactions are isolated
setCursorName()
public native void setCursorName( String cursorName ) throws Exception;
setParam()
// public native void setParam();
setPos()
public native void setPos( int rowIndex,
boolean fRefresh,
boolean fLock ) throws Exception;
setScrollOptions()
public native void setScrollOptions( int fConcurrency,
int crowKeyset,
int crowRowset ) throws Exception;
name Num Str description
ASYNC_ENABLE * when set TRUE, SQL statements
are executed asynchronously
BIND_TYPE * sets the binding type
CONCURRENCY * sets cursor concurrencies,
see below.
CURSOR_TYPE * sets the cursor type on the
statement handle
GET_BOOKMARK not supported!
KEYSET_SIZE * sets the size of the key set
MAX_LENGTH * sets the maximum length of a
result column of a query, use MAX_LENGTH_DEFAULT for no limit
MAX_ROWS * sets the maximum number of
rows producable by a query, use MAX_ROWS_DEFAULT for no limit
NOSCAN * when set TRUE, there is no scan
for escape sequences in SQL statements
QUERY_TIMEOUT * sets the timeout value on
queries, use QUERY_TIMEOUT_DEFAULT for no limit
RETRIEVE_DATA not supported!
ROW_NUMBER not supported!
ROWSET_SIZE * sets the size of the row set
SIMULATE_CURSOR not supported!
USE_BOOKMARKS not supported!
specialColumns()
public native void specialColumns( int fColType,
String tableQualifier,
String tableOwner,
String tableName,
int fScope,
boolean fNullable ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
statistics()
public native void statistics( String tableQualifier,
String tableOwner,
String tableName,
boolean fUnique,
boolean fAccuracy ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
tablePrivileges()
public native void tablePrivileges( String tableQualifier,
String tableOwner,
String tableName ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
tables()
public native void tables( String tableQualifier,
String tableOwner,
String tableName,
String tableType ) throws Exception;
The result may vary depending on the database software (i.e. ODBC driver).
Consult the appropriate documentation there!
transact()
public native void transact( int fType ) throws Exception;
class J2ODBCException
constructors
public J2ODBCException();
public J2ODBCException( String reason );
public J2ODBCException( String reason, String SQLState );
public J2ODBCException( String reason, String SQLState, int vendorCode );
class J2ODBCWarning
constructors
public J2ODBCWarning();
public J2ODBCWarning( String reason );
public J2ODBCWarning( String reason, String SQLState );
public J2ODBCWarning( String reason, String SQLState, int vendorCode );
Classes of the JDBC interface
Class JdbcOdbcCallableStatement
constructors
public JdbcOdbcCallableStatement( Connection dbConnection,
J2ODBC odbcObj,
String sql ) throws SQLException;
get...()
public boolean getBoolean( int parameterIndex ) throws SQLException;
public byte getByte( int parameterIndex ) throws SQLException:
public byte[] getBytes( int parameterIndex ) throws SQLException;
public java.sql.Date getDate( int parameterIndex ) throws SQLException;
public double getDouble( int parameterIndex ) throws SQLException;
public float getFloat( int parameterIndex ) throws SQLException;
public int getInt( int parameterIndex ) throws SQLException;
public long getLong( int parameterIndex ) throws SQLException;
public Bignum getBignum( int parameterIndex, int scale ) throws SQLException;
public Object getObject( int parameterIndex ) throws SQLException;
public short getShort( int parameterIndex ) throws SQLException;
public String getString( int parameterIndex ) throws SQLException;
public java.sql.Time getTime( int parameterIndex ) throws SQLException;
public java.sql.Timestamp getTimestamp( int parameterIndex )
throws SQLException;
method SQL data type(s)
getBoolean() BIT
getByte() TINYINT
getBytes() BINARY, VARBINARY
getDate() DATE
getDouble() DOUBLE
getFloat() FLOAT
getInt() INTEGER
getLong() BIGINT
getBignum() NUMERIC
getObject() any data type (see below)
getShort() SMALLINT
getString() CHAR, VARCHAR, LONGVARCHAR
getTime() TIME
getTimestamp() TIMESTAMP
getObject() returns an object for a SQL data type, which has been
previously set by
registerOutParameter().
It may also be used to handle non-ODBC conformant data types or database vendor
specific data type extension.
registerOutParameter()
public void registerOutParameter( int parameterIndex, int sqlType )
throws SQLException;
public void registerOutParameter( int parameterIndex, int sqlType, int scale )
throws SQLException;
wasNull()
public boolean wasNull() throws SQLException;
Class JdbcOdbcConnection
definitions
constructors
public JdbcOdbcConnection( String user, String passwd, String db )
throws SQLException;
destructors
public void finalize() throws SQLException;
clearWarnings()
public void clearWarnings() throws SQLException;
close()
public void close() throws SQLException;
commit()
public void commit() throws SQLException;
createStatement()
public Statement createStatement() throws SQLException;
getAutoClose()
public boolean getAutoClose() throws SQLException;
getAutoCommit()
public boolean getAutoCommit() throws SQLException;
getCatalog()
public String getCatalog() throws SQLException;
getMetaData()
public DatabaseMetaData getMetaData() throws SQLException;
getTransactionIsolation()
public int setTransactionIsolation() throws SQLException;
getWarnings()
public SQLWarning getWarnings() throws SQLException;
isClosed()
public boolean isClosed() throws SQLException;
isReadOnly()
public boolean isReadOnly() throws SQLException;
nativeSql()
public String nativeSQL( String sql ) throws SQLException;
prepareCall()
public CallableStatement prepareCall( String sql ) throws SQLException;
prepareStatement()
public PreparedStatement prepareStatement( String sql ) throws SQLException;
queryOdbcBridge()
public J2ODBC queryOdbcBridge() throws J2ODBCException;
rollback()
public void rollback() throws SQLException;
setAutoClose()
public void setAutoClose( boolean autoClose ) throws SQLException;
setAutoCommit()
public void setAutoCommit( boolean autoCommit ) throws SQLException;
setCatalog()
public void setCatalog( String catalog ) throws SQLException;
On the JDBC-ODBC bridge, this method does not have any effect.
setReadOnly()
public void setReadOnly( boolean readOnly ) throws SQLException;
setTransactionIsolation()
public void setTransactionIsolation( int level ) throws SQLException;
Class JdbcOdbcDatabaseMetaData
Class JdbcOdbcDriver
new iODBC.sql.JdbcOdbcDriver();
constructors
public JdbcOdbcDriver() throws SQLException;
acceptsURL()
public boolean acceptsURL( String url ) throws SQLException;
connect()
public Connection connect( String url, java.util.Properties info )
throws SQLException;
For connecting to the ODBC source test via JDBC-ODBC bridge, use
the url = jdbc:odbc:test.
getMajorVersion()
public int getMajorVersion();
getMinorVersion()
public int getMinorVersion();
getPropertyInfo()
public DriverPropertyInfo[] getPropertyInfo( String url,
java.util.Properties info
) throws SQLException;
jdbcCompliant()
public boolean jdbcCompliant();
Class JdbcOdbcPreparedStatement
constructors
public JdbcOdbcPreparedStatement( Connection dbConnection,
J2ODBC odbcObj,
String sql ) throws SQLException;
clearParameter()
public void clearParameters() throws SQLException;
execute()
public boolean execute() throws SQLException;
executeQuery()
public ResultSet executeQuery() throws SQLException;
executeUpdate()
public int executeUpdate() throws SQLException;
method SQL data type(s)
setBoolean() BIT
setByte() TINYINT
setBytes() BINARY, VARBINARY
setDate() DATE
setDouble() DOUBLE
setFloat() FLOAT
setInt() INTEGER
setLong() BIGINT
setBignum() NUMERIC
setShort() SMALLINT
setString() CHAR, VARCHAR, LONGVARCHAR
setTime() TIME
setTimestamp() TIMESTAMP
Depending on the database software, more than one method (SQL data type) may
be used for an IN parameter.
setNull()
public void setNull( int parameterIndex, int sqlType ) throws SQLException;
setObject()
public void setObject( int parameterIndex, Object x ) throws SQLException;
public void setObject( int parameterIndex, Object x, int targetSqlType )
throws SQLException;
public void setObject( int parameterIndex, Object x, int targetSqlType,
int scale ) throws SQLException;
If there is no targetSqlType parameter, the appropriate SQL data
type is converted by the identified Java data type of x.
setAsciiStream()
public void setAsciiStream( int parameterIndex, java.io.InputStream x,
int length ) throws SQLException;
Data is transmitted as ASCII characters.
setBinaryStream()
public void setBinaryStream( int parameterIndex, java.io.InputStream x,
int length ) throws SQLException;
Data is transmitted as binary data.
setUnicodeStream()
public void setUnicodeStream( int parameterIndex, java.io.InputStream x,
int length ) throws SQLException;
Data is transmitted as Unicodes.
Class JdbcOdbcResultSet
constructors
public JdbcOdbcResultSet( J2ODBC newDb );
clearWarnings()
public void clearWarnings() throws SQLException;
close()
public void close() throws SQLException;
findColumn()
public int findColumn( String columnName ) throws SQLException;
method SQL data type(s)
getBoolean() BIT
getByte() TINYINT
getBytes() BINARY, VARBINARY
getDate() DATE
getDouble() DOUBLE
getFloat() FLOAT
getInt() INTEGER
getLong() BIGINT
getBignum() NUMERIC
getShort() SMALLINT
getString() CHAR, VARCHAR, LONGVARCHAR
getTime() TIME
getTimestamp() TIMESTAMP
getAsciiStream()
public java.io.InputStream getAsciiStream( int columnIndex )
throws SQLException;
public java.io.InputStream getAsciiStream( String columnName )
throws SQLException;
Data is transmitted as ASCII characters.
getBinaryStream()
public java.io.InputStream getBinaryStream( int columnIndex )
throws SQLException;
public java.io.InputStream getBinaryStream( String columnName )
throws SQLException;
Data is transmitted as binary data.
getCursorName()
public String getCursorName() throws SQLException;
getMetaData()
public ResultSetMetaData getMetaData() throws SQLException;
getObject()
public Object getObject( int columnIndex ) throws SQLException;
public Object getObject( String columnName ) throws SQLException;
public Object getObject( int columnIndex, int targetSqlType )
throws SQLException;
public Object getObject( String columnName, int targetSqlType )
throws SQLException;
public Object getObject( int columnIndex, int targetSqlType, int scale )
throws SQLException;
public Object getObject( String columnName, int targetSqlType, int scale )
throws SQLException;
getUnicodeStream()
public java.io.InputStream getUnicodeStream( int columnIndex )
throws SQLException;
public java.io.InputStream getUnicodeStream( String columnName )
throws SQLException;
Data is transmitted as Unicode characters.
getWarnings()
public SQLWarning getWarnings() throws SQLException;
next()
public boolean next() throws SQLException;
wasNull()
public boolean wasNull() throws SQLException;
Class JdbcOdbcResultSetMetaData
definitions
constructors
public JdbcOdbcResultSetMetaData( J2ODBC newDb );
getCatalogName()
public String getCatalogName( int columnIndex ) throws SQLException;
getColumnCount()
public int getColumnCount() throws SQLException;
getColumnDisplaySize()
public int getColumnDisplaySize( int columnIndex ) throws SQLException;
getColumnLabel()
public String getColumnLabel( int columnIndex ) throws SQLException;
getColumnName()
public String getColumnName( int columnIndex ) throws SQLException;
getColumnType()
public int getColumnType( int columnIndex ) throws SQLException;
getColumnTypeName()
public String getColumnTypeName( int columnIndex ) throws SQLException;
getPrecision()
public int getPrecision( int columnIndex ) throws SQLException;
getScale()
public int getScale( int columnIndex ) throws SQLException;
getSchemaName()
public String getSchemaName( int columnIndex ) throws SQLException;
getTableName()
public String getTableName( int columnIndex ) throws SQLException;
isAutoIncrement()
public boolean isAutoIncrement( int columnIndex ) throws SQLException;
Such columns normally are read-only.
isCurrency()
public boolean isCurrency( int columnIndex ) throws SQLException;
isCaseSensitive()
public boolean isCaseSensitive( int columnIndex ) throws SQLException;
isDefinitelyWritable()
public boolean isDefinitelyWritable( int columnIndex ) throws SQLException;
isNullable()
public int isNullable( int columnIndex ) throws SQLException;
isReadOnly()
public boolean isReadOnly( int columnIndex ) throws SQLException;
isSearchAble()
public boolean isSearchable( int columnIndex ) throws SQLException;
isSigned()
public boolean isSigned( int columnIndex ) throws SQLException;
isWritable()
public boolean isWritable( int columnIndex ) throws SQLException;
Class JdbcOdbcStatement
A SQL statement may return only one result set or none, but no more.
constructors
public JdbcOdbcStatement( Connection dbConnection, J2ODBC odbcObj )
throws SQLException;
cancel()
public void cancel() throws SQLException;
clearWarnings()
public void clearWarnings() throws SQLException;
close()
public void close() throws SQLException;
execute()
public boolean execute( String sql ) throws SQLException;
executeQuery()
public java.sql.ResultSet executeQuery( String sql ) throws SQLException;
This method may be used on queries.
executeUpdate()
public int executeUpdate( String sql ) throws SQLException;
This method may be used on statements not returning data, like
DELETE, INSERT or UPDATE.
getCursorName()
public String getCursorName() throws SQLException;
getMaxFieldSize()
public int getMaxFieldSize() throws SQLException;
getMaxRows()
public int getMaxRows() throws SQLException;
getMoreResultSet()
public boolean getMoreResults() throws SQLException;
getQueryTimeout()
public int getQueryTimeout() throws SQLException;
getResultSet()
public java.sql.ResultSet getResultSet() throws SQLException;
getWarnings()
public SQLWarning getWarnings() throws SQLException;
getUpdateCount()
public int getUpdateCount() throws SQLException;
setCursorName()
public void setCursorName( String name ) throws SQLException;
setEscapeProcessing()
public void setEscapeProcessing( boolean enable ) throws SQLException;
setMaxFieldSize()
public void setMaxFieldSize( int max ) throws SQLException;
setMaxRows()
public void setMaxRows( int max ) throws SQLException;