|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface declares basic functionality to access a database.
It's possible to retrieve information on tables and columns within
a table. E.g. testing if a specific table exists in the database
or what columns exist in a specific table.
There is also functionality to send SQL statements directly to the
database or to precompile often used statements for better
performance.
and the java.sql package for more detailed
information on how to handle ResultSets.
Method Summary | |
void |
close()
Closes the connection to the database. |
boolean |
columnExists(java.lang.String tableName,
int columnIndex)
Tests if a column exists. |
boolean |
columnExists(java.lang.String tableName,
java.lang.String columnName)
Tests if a column exists. |
void |
commit()
Commits pending data to the database. |
java.sql.ResultSet |
executeQuery(java.lang.String statement)
Executes an Query from a SQL statement. |
void |
executeUpdate(java.lang.String statement)
Executes an Update statement. |
int |
getColumnCount(java.sql.ResultSet result)
Returns the column count of a ResultSet. |
int |
getColumnCount(java.lang.String tableName)
Returns the column count of the table. |
java.sql.ResultSet |
getColumnDescription(java.lang.String tableName,
int columnIndex)
Returns a ResultSet containing a description of the column. |
java.sql.ResultSet |
getColumnDescription(java.lang.String tableName,
java.lang.String columnName)
Returns a ResultSet containing a description of the column. |
java.sql.ResultSet |
getColumnDescriptions(java.lang.String tableName)
Returns a ResultSet containing a description of all columns in table. |
java.lang.String[] |
getColumnNames(java.sql.ResultSet result)
Returns the names of the Columns in a ResultSet. |
java.lang.String[] |
getColumnNames(java.lang.String tableName)
Returns all column names for the table. |
java.util.Vector |
getColumnNamesVector(java.sql.ResultSet result)
Returns the names of the Columns in a ResultSet. |
java.util.Vector |
getColumnNamesVector(java.lang.String tableName)
Returns all column names for the table. |
int |
getTableCount()
Returns the table count of the database. |
java.sql.ResultSet |
getTableDescription(java.lang.String tableName)
Returns a ResultSet containing description of a table. |
java.sql.ResultSet |
getTableDescriptions()
Returns a ResultSet containing the descriptions of all tables. |
java.lang.String[] |
getTablenames()
Returns names of all tables within the database. |
java.util.Vector |
getTablenamesVector()
Returns names of all tables within the database. |
boolean |
isClosed()
Tests if is closed. |
void |
open()
Opens the connection to the database. |
java.sql.PreparedStatement |
precompile(java.lang.String statement)
Precompiles a SQL statement. |
boolean |
tableExists(java.lang.String tableName)
Tests if a table exists. |
Method Detail |
public void open() throws java.lang.ClassNotFoundException, java.sql.SQLException, java.lang.InstantiationException, java.lang.IllegalAccessException
public void close() throws java.sql.SQLException, NotConnectedException
public void commit() throws java.sql.SQLException, NotConnectedException
public java.sql.PreparedStatement precompile(java.lang.String statement) throws java.sql.SQLException, NotConnectedException
public java.sql.ResultSet executeQuery(java.lang.String statement) throws java.sql.SQLException, NotConnectedException
statement
- The SQL satement to execute.public void executeUpdate(java.lang.String statement) throws java.sql.SQLException, NotConnectedException
statement
- The SQL satement to execute.public java.lang.String[] getTablenames() throws java.sql.SQLException, NotConnectedException
public java.sql.ResultSet getTableDescription(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
tableName
- The name of the table.public java.sql.ResultSet getTableDescriptions() throws java.sql.SQLException, NotConnectedException
public java.lang.String[] getColumnNames(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
tableName
- The table name.public java.lang.String[] getColumnNames(java.sql.ResultSet result) throws java.sql.SQLException
result
- The ResultSet to examine.public java.sql.ResultSet getColumnDescription(java.lang.String tableName, java.lang.String columnName) throws java.sql.SQLException, NotConnectedException
tableName
- The name of the table.columnName
- The name of the column.public java.sql.ResultSet getColumnDescription(java.lang.String tableName, int columnIndex) throws java.sql.SQLException, NotConnectedException, java.lang.IndexOutOfBoundsException
tableName
- The name of the table.columnName
- The name of the column.public java.sql.ResultSet getColumnDescriptions(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
tableName
- The name of the table.public boolean tableExists(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
tableName
- The name of the table.public boolean columnExists(java.lang.String tableName, java.lang.String columnName) throws java.sql.SQLException, NotConnectedException
tableName
- The name of the table.columnName
- The name of the column.public boolean columnExists(java.lang.String tableName, int columnIndex) throws java.sql.SQLException, NotConnectedException
tableName
- The name of the table.columnIndex
- The index of the column.public boolean isClosed() throws java.sql.SQLException, NotConnectedException
public int getColumnCount(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
tableName
- The name of the table.public int getColumnCount(java.sql.ResultSet result) throws java.sql.SQLException
tableName
- The name of the table.public int getTableCount() throws java.sql.SQLException, NotConnectedException
public java.util.Vector getColumnNamesVector(java.sql.ResultSet result) throws java.sql.SQLException
result
- The ResultSet to examine.public java.util.Vector getColumnNamesVector(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
tableName
- The table name.public java.util.Vector getTablenamesVector() throws java.sql.SQLException, NotConnectedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |