|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.web.databasesupport.tools.database.SimpleDatabase
Implemented Interface Database.
Field Summary | |
static int |
COLUMN_BUFFER_LENGTH
|
static int |
COLUMN_CHAR_OCTET_LENGTH
|
static int |
COLUMN_DATA_TYPE
|
static int |
COLUMN_DECIMAL_DIGITS
|
static int |
COLUMN_DEF
|
static int |
COLUMN_IS_NULLABLE
|
static int |
COLUMN_NAME
|
static int |
COLUMN_NULLABLE
|
static int |
COLUMN_NUM_PREC_RADIX
|
static int |
COLUMN_ORDINAL_POSITION
|
static int |
COLUMN_REMARKS
|
static int |
COLUMN_SIZE
|
static int |
COLUMN_SQL_DATA_TYPE
|
static int |
COLUMN_SQL_DATETIME_SUB
|
static int |
COLUMN_TYPE_NAME
|
static java.lang.String |
JDATA2_0_DRIVER
Driver for an ODBC-Database. |
static java.lang.String |
JDBC_ODBC_DRIVER
Driver for an JDBC-ODBC-Database like MS Access. |
static int |
TABLE_CAT
|
static int |
TABLE_NAME
|
static int |
TABLE_REMARKS
|
static int |
TABLE_SCHEM
|
static int |
TABLE_TYPE
|
Constructor Summary | |
SimpleDatabase(java.lang.String jdbcDriver,
java.lang.String jdbcConnection)
Constructor An URL for the JDBC:ODBC-Driver can look like "jdbc:odbc:YourDB". |
|
SimpleDatabase(java.lang.String jdbcDriver,
java.lang.String jdbcConnection,
java.util.Properties prop)
Constructor An URL for the JDBC:ODBC-Driver can look like "jdbc:odbc:YourDB". |
|
SimpleDatabase(java.lang.String jdbcDriver,
java.lang.String jdbcConnection,
java.lang.String username,
java.lang.String password)
Constructor An URL for the JDBC:ODBC-Driver can look like "jdbc:odbc:YourDB". |
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. |
java.sql.Connection |
getConnection()
Returns the connection. |
protected java.lang.String |
getDriver()
Returns the driver. |
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 opened. |
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. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int TABLE_CAT
public static final int TABLE_SCHEM
public static final int TABLE_NAME
public static final int TABLE_TYPE
public static final int TABLE_REMARKS
public static final int COLUMN_NAME
public static final int COLUMN_DATA_TYPE
public static final int COLUMN_TYPE_NAME
public static final int COLUMN_SIZE
public static final int COLUMN_BUFFER_LENGTH
public static final int COLUMN_DECIMAL_DIGITS
public static final int COLUMN_NUM_PREC_RADIX
public static final int COLUMN_NULLABLE
public static final int COLUMN_REMARKS
public static final int COLUMN_DEF
public static final int COLUMN_SQL_DATA_TYPE
public static final int COLUMN_SQL_DATETIME_SUB
public static final int COLUMN_CHAR_OCTET_LENGTH
public static final int COLUMN_ORDINAL_POSITION
public static final int COLUMN_IS_NULLABLE
public static final java.lang.String JDATA2_0_DRIVER
public static final java.lang.String JDBC_ODBC_DRIVER
Constructor Detail |
public SimpleDatabase(java.lang.String jdbcDriver, java.lang.String jdbcConnection)
jdbcDriver
- The driver to connect to the database.jdbcConnection
- The url of the connection.public SimpleDatabase(java.lang.String jdbcDriver, java.lang.String jdbcConnection, java.lang.String username, java.lang.String password)
jdbcDriver
- The driver to connect to the database.jdbcConnection
- The url of the connection.username
- The name of the user.password
- The password of the user.public SimpleDatabase(java.lang.String jdbcDriver, java.lang.String jdbcConnection, java.util.Properties prop)
jdbcDriver
- The driver to connect to the database.jdbcConnection
- The url of the connection.username
- The name of the user.password
- The password of the user.Method Detail |
public void open() throws java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
open
in interface Database
public void close() throws java.sql.SQLException, NotConnectedException
close
in interface Database
public void commit() throws java.sql.SQLException, NotConnectedException
commit
in interface Database
public java.sql.PreparedStatement precompile(java.lang.String statement) throws java.sql.SQLException, NotConnectedException
precompile
in interface Database
public void executeUpdate(java.lang.String statement) throws java.sql.SQLException, NotConnectedException
executeUpdate
in interface Database
statement
- The SQL satement to execute.public java.sql.ResultSet executeQuery(java.lang.String statement) throws java.sql.SQLException, NotConnectedException
executeQuery
in interface Database
statement
- The SQL satement to execute.public java.lang.String[] getTablenames() throws java.sql.SQLException, NotConnectedException
getTablenames
in interface Database
public java.util.Vector getTablenamesVector() throws java.sql.SQLException, NotConnectedException
getTablenamesVector
in interface Database
public java.sql.ResultSet getTableDescription(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
getTableDescription
in interface Database
tableName
- The name of the table.public java.sql.ResultSet getTableDescriptions() throws java.sql.SQLException, NotConnectedException
getTableDescriptions
in interface Database
public java.lang.String[] getColumnNames(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
getColumnNames
in interface Database
tableName
- The table name.public java.util.Vector getColumnNamesVector(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
getColumnNamesVector
in interface Database
tableName
- The table name.public java.sql.ResultSet getColumnDescription(java.lang.String tableName, java.lang.String columnName) throws java.sql.SQLException, NotConnectedException
getColumnDescription
in interface Database
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
getColumnDescription
in interface Database
tableName
- The name of the table.columnIndex
- The index of the column must be greater 0.public java.sql.ResultSet getColumnDescriptions(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
getColumnDescriptions
in interface Database
tableName
- The name of the table.public boolean tableExists(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
tableExists
in interface Database
tableName
- The name of the table.public boolean columnExists(java.lang.String tableName, java.lang.String columnName) throws java.sql.SQLException, NotConnectedException
columnExists
in interface Database
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
columnExists
in interface Database
tableName
- The name of the table.columnIndex
- The index of the column.public boolean isClosed() throws java.sql.SQLException
isClosed
in interface Database
public int getColumnCount(java.lang.String tableName) throws java.sql.SQLException, NotConnectedException
getColumnCount
in interface Database
tableName
- The name of the table.public java.lang.String[] getColumnNames(java.sql.ResultSet result) throws java.sql.SQLException
getColumnNames
in interface Database
result
- The ResultSet to examine.public java.util.Vector getColumnNamesVector(java.sql.ResultSet result) throws java.sql.SQLException
getColumnNamesVector
in interface Database
result
- The ResultSet to examine.public int getColumnCount(java.sql.ResultSet result) throws java.sql.SQLException
getColumnCount
in interface Database
tableName
- The name of the table.public int getTableCount() throws java.sql.SQLException, NotConnectedException
getTableCount
in interface Database
public java.sql.Connection getConnection()
protected java.lang.String getDriver()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |