JDBC Section Index | Page 3
One unfortunate aspect of RowSetMetaData for custom versions is that it is an interface. This means that implementations almost have to be proprietary. The JDBC RowSet package is the most common...more
The basics are: Create an object that implements javax.sql.RowSetReader, which loads the data. Instantiate a CachedRowset object. Set the CachedRowset's reader to the reader object previous...more
Can I set up a conection pool with multiple user IDs? The single ID we are forced to use causes probelems when debugging the DBMS.
Since the Connection interface ( and the underlying DBMS ) requires a specific user and password, there's not much of a way around this in a pool. While you could create a different Connection fo...more
Detecting Duplicate Keys I have a program that inserts rows in a table. My table has a column 'Name' that has a unique constraint. If the user attempts to insert a duplicate name into the table, I ...more
How can I protect my database password ? I'm writing a client-side java application that will access a database over the internet. I have concerns about the security of the database passwords. The ...more
Can you scroll a result set returned from a stored procedure? I am returning a result set from a stored procedure with type SQLRPGLE but once I reach the end of the result set it does not allow rep...more
Driver memory problem I am using interclient driver to connect to interbase. My program does lots of inserts, updates, selects, etc. The problem I found is that if I create a statement for each ope...more
Sun recommends using the thin ( type 4 ) driver. On single processor machines to avoid JNI overhead. On multiple processor machines, especially running Solaris, to avoid synchronization bottl...more
This code snippet shows the basics: File file = new File(fPICTURE); FileInputStream fis = new FileInputStream(file); PreparedStatement ps = ConrsIn.prepareStatement("insert into dbPICTURE val...more
From the standard JDBC perspective, there is no difference between ASCII/8859-1 characters and those above 255 ( hex FF ). The reason for that is that all Java characters are in Unicode ( unless ...more
I'd like to evaluate the Object/Relational Mapping approach and products. Any discussion is helpful.
jguru Disclaimer: The following views and opinions are entirely those of the respondents and provided for our readers to consider. jGuru is not in the business of evaluating products. Disclaime...more
I think you mean "lock a table in exclusive mode". You cannot open a connection with exclusive mode. Depending on your database engine, you can lock tables or rows in exclusive mode. In Oracle ...more
Use DatabaseMetaData.supportsTransactionIsolationLevel(int level). See also: How does one manage concurrency issues with JDBC?
Update fails without blank padding. Alhough a particular row is present in the database for a given key, executeUpdate() shows 0 rows updated and, in fact, the table is not updated. If I pad the Ke...more
What isolation level is used by the DBMS when inserting, updating and selecting rows from a database?
The answer depends on both your code and the DBMS. If the program does not explicitly set the isolation level, the DBMS default is used. You can determine the default using DatabaseMetaData.getD...more