JDBC Section Index | Page 7
Does the database server have to be running Java or have Java support in order for my remote JDBC client app to access the database?
The answer should always be no. The two critical requirements are LAN/internet connectivity and an appropriate JDBC driver. Connectivity is usually via TCP/IP, but other communication protocols ...more
Are the code examples from the JDBC API Tutorial and Reference, Second Edition available online?
Yes. The code examples for both the first and second editions of the closest thing to a JDBC bible can be downloaded from JDBC Data Access API BOOK CODE SAMPLES.more
Which Java and java.sql data types map to my specific database types?
JDBC is, of necessity, reliant on the driver and underlying DBMS. These do not always adhere to standards as closely as we would like, including differing names for standard Java types. To deal w...more
When an SQL select statement doesn't return any rows, is an SQLException thrown?
No. If you want to throw an exception, you could wrap your SQL related code in a custom class and throw something like ObjectNotFoundException when the returned ResultSet is empty.
Joe Sam Shirah...more
What is optimistic concurrency?
An optimistic approach dispenses with locks ( except during the actual update ) and usually involves comparison of timestamps, or generations of data to ensure that data hasn't changed between acc...more
What is pessimistic concurrency?
With a pessimistic approach, locks are used to ensure that no users, other than the one who holds the lock, can update data. It's generally explained that the term pessimistic is used because the...more
Why should I consider optimistic versus pessimistic approaches to database updates?
In a modern database, possibly the two most important issues are data integrity and concurrency ( multiple users have access to and can update the data ). Either approach can be appropriate, depe...more
Can I get information about a ResultSet's associated Statement and Connection in a method without having or adding specific arguments for the Statement and Connection?
Yes. Use ResultSet.getStatement(). From the resulting Statement you can use Statement.getConnection().
What is the most efficient method of replicating data betwen databases using JDBC?
Within Java, the most efficient method would be, opening connections using the JDBC and inserting or updating the records from one database to the other database, but it depends upon the databases...more
How can I tell if my JDBC driver normalizes java.sql.Date and java.sql.Time objects?
To actually determine the values, the objects must be converted to a java.util.Date and examined. See What does normalization mean for java.sql.Date and java.sql.Time? for the definition of norma...more
What's the difference between MySQL and mSQL?
The creators of mySQL are doing a great job in maintaining in the documentation pages with all the differences between the two databases (and others, like PostgreSQL). Personally I don't think the...more
What is the difference between setMaxRows(int) and SetFetchSize(int)? Can either reduce processing time?
setFetchSize(int) defines the number of rows that will be read from the database when the ResultSet needs more rows. The method in the java.sql.Statement interface will set the 'default' value for...more
Is there a JDO FAQ available?
The closest thing to a JDO FAQ is the Transparent Persistence FAQ available with Forte.
What is JDO?
JDO provides for the transparent persistence of data in a data store agnostic manner, supporting object, hierarchical, as well as relational stores.
Where can I learn about Java Data Objects?
The home of JDO is off the beaten path at Sun. You can find its home at http://access1.sun.com/jdo/.