JDBC Section Index | Page 20
How do I check what table types exist in a database?
Use the getTableTypes method of interface
java.sql.DatabaseMetaData to probe the database for table types.
The exact usage is described in the code below.
public static void main(S...more
How do I check what table-like database objects (table, view, temporary table, alias) are present in a particular database?
Use java.sql.DatabaseMetaData to probe the database for metadata. Use the getTables method to retrieve information about all database objects (i.e. tables, views, system tables, temporary global o...more
At a glance, how does the Java Database Connectivity (JDBC) work?
A: The JDBC is used whenever a Java application should communicate with a relational database for which a JDBC driver exists. JDBC is part of the Java platform standard; all visible ...more
Can I make a change to the transaction isolation level in the midst of executing the transaction?
Although you may want to avoid it, you can change the transaction
isolation level in the midst of executing a transaction. However, this will
immediately freeze all the changes made upto that po...more
What is a "dirty read"?
Quite often in database processing, we come across the situation wherein one transaction
can change a value, and a second transaction can read this value before the original
change has been comm...more
What is the advantage of using a PreparedStatement?
For SQL statements that are executed repeatedly, using a PreparedStatement object would
almost always be faster than using a Statement object. This is because creating a
PreparedStatement object...more
What is Metadata and why should I use it?
Metadata ('data about data') is information about one of two things:
Database information (java.sql.DatabaseMetaData), or
Information about a specific ResultSet (java.sql.ResultSetMetaData).
...more
What is the difference between a Statement and a PreparedStatement?
Short answer:
The PreparedStatement is a slightly
more powerful version of a Statement,
and should always be at least as quick and eas...more
How do I create a database connection?
The database connection is created in 3 steps:
Find a proper database URL (see FAQ on JDBC URL)
Load the database driver
Ask the Java DriverManager class to open a connection to your database...more
What types of JDBC drivers exist?
There are four types of JDBC database driver:
Driver type code
Explanation
Comment
1
The JDBC/ODBC bridge driver
A piece of native C-code that translates a JDBC call to an ODB...more
What is a database URL?
A database URL (or JDBC URL) is a platform independent way of adressing a database. A database/JDBC URL is of the form
jdbc:[subprotocol]:[node]/[databaseName]
If you are accessing a databas...more