All Packages Class Hierarchy This Package Previous Next Index
Class examples.jdbc.Table
java.lang.Object
|
+----examples.jdbc.Table
- public class Table
- extends Object
This class provides a basic service for managing database tables.
-
Table(Connection)
- Creates a
Table to manage database tables.
-
createTable(String, String)
- Creates a database table.
-
destroyTable(String)
- Drops a database table.
-
tableExists(String)
- Tests the existence of a database table.
-
tableSize(String)
- Determines the size of a database table.
-
traceSqlException(SQLException)
- Displays the
SQLException and additional error information.
Table
public Table(Connection connection)
- Creates a
Table to manage database tables.
createTable
public void createTable(String tableName,
String tableStructure) throws SQLException
- Creates a database table.
- Parameters:
- tableName - The name of the database table to be created.
- tableStructure - The structure of the database table to be created.
- Throws: SQLException
- A database-access error occured.
destroyTable
public void destroyTable(String tableName) throws SQLException
- Drops a database table.
- Parameters:
- tableName - The name of the database table to be droped.
- Throws: SQLException
- A database-access error occured.
tableExists
public boolean tableExists(String tableName)
- Tests the existence of a database table.
- Parameters:
- tableName - The name of the database table.
tableSize
public int tableSize(String tableName) throws SQLException
- Determines the size of a database table.
- Parameters:
- tableName - The name of the database table.
- Returns:
- The number of existing rows in the table.
- Throws: SQLException
- A database-access error occured.
traceSqlException
public static void traceSqlException(SQLException exception)
- Displays the
SQLException and additional error information.
- Parameters:
- exception - The SQLException to displayed.
All Packages Class Hierarchy This Package Previous Next Index