JDBC Section Index | Page 6
How can I execute multiple select queries with a single executeQuery()?
How can I execute multiple select queries with a single executeQuery()? I just read the article in JavaWorld "JDBC usage for industrial-strength performance, Part 2". But when I ran the code I am ...more
How does one get column names for rows returned in a ResultSet?
ResultSet rs = ...
...
ResultSetMetaData rsmd = rs.getMetaData();
int numCols = rsmd.getColumnCount();
for (int i = 1; i <= numCols; i++)
{
System.out.println("[" + i + "]" +
rsmd.ge...more
I have an application that queries a database and retreives the results into a JTable. This is the code in the model that seems to be taken forever to execute, especially for a large result set:
I have an application that queries a database and retreives the results into a JTable. This is the code in the model that seems to be taken forever to execute, especially for a large result set:
w...more
What are the considerations for deciding on transaction boundaries?
Transaction processing should always deal with more than one statement and a transaction is often described as a Logical Unit of Work ( LUW ). The rationale for transactions is that you want to k...more
What is the JDBC syntax for using a date literal or variable in a standard Statement?
While you are generally advised to use a PreparedStatement and let the driver handle the syntax, the following is the standard form for regular Statements.
The general escape syntax for standard ...more
Can I use JDBC to execute non-standard features that my DBMS provides?
The answer is a qualified yes. As discussed under SQL Conformance: "One way the JDBC API deals with this problem is to allow any query string to be passed through to an underlying DBMS driver. Th...more
How can I determine where a given table is referenced via foreign keys?
DatabaseMetaData.getExportedKeys() returns a ResultSet with data similar to that returned by DatabaseMetaData.getImportedKeys(), except that the information relates to other tables that reference ...more
How can I get information about foreign keys used in a table?
DatabaseMetaData.getImportedKeys() returns a ResultSet with data about foreign key columns, tables, sequence and update and delete rules. For sample code, look at ForeignKeysCoffees.java in the d...more
Is there a standard JDBC means of creating a database?
No, because there is no SQL standard method. The basis is mostly historical, because almost every DBMS uses a different syntax and arguments and often requires special permissions. In my JDBC 2....more
Does anyone know of a JDBC driver for SQL Server 2000 that supports Windows Authentication?ase.
Does anyone know of a JDBC driver for SQL Server 2000 that supports Windows Authentication?
Meaning a username and password does not need to be supplied when connecting to the database.
What is DDL?
DDL is an abbreviation for Data Definition Language. This portion of the SQL standard is concerned with the creation, deletion and modification of database objects like tables, indexes and views....more
What is DML?
DML is an abbreviation for Data Manipulation Language. This portion of the SQL standard is concerned with manipulating the data in a database as opposed to the structure of a database. The core ...more
What is the significance of DataBaseMetaData.tableIndexStatistics? How to obtain and use it?
To answer the second question first, the tableIndexStatistic constant in the TYPE column will identify one of the rows in the ResultSet returned when DatabaseMetaData.getIndexInfo() is invoked. I...more
What is a JDBC 2.0 DataSource?
The DataSource class was introduced in the JDBC 2.0 Optional Package as an easier, more generic means of obtaining a Connection. The actual driver providing services is defined to the DataSource ...more
What types of DataSource objects are specified in the Optional Package?
Basic - Provides a standard Connection object.
Pooled - Provides a Connection pool and returns a Connection that is controlled by the pool.
Distributed - Provides a Connection that can part...more