This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC API 2.0 Help... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC API 2.0 Help..." Watch "JDBC API 2.0 Help..." New topic
Author

JDBC API 2.0 Help...

Chen ZhiJiang
Ranch Hand

Joined: May 18, 2002
Posts: 72
I using J2SDK 1.4 and mysql JDBC Driver.
JDBC 2.0 should support UPDATABLE ResultSet. Any thing wrong with my code:

when i run it, it shows the ResultSet isn't UPDATABLE...
Can anybody help...
[ Edited by Dave to format code ]
[ July 08, 2002: Message edited by: David O'Meara ]

SCJP SCEA-I
Kevin Barrett
Greenhorn

Joined: Jan 15, 2002
Posts: 2
What does rs.getConcurrency() print? Could it be a bug with the driver?
Chen ZhiJiang
Ranch Hand

Joined: May 18, 2002
Posts: 72
rs.getConcurrency() print out the code that means whether this ResultSet support UPDATABLE or Not.
I got same problem with JDBC-ODBC Bridge for MS Access.
Using JDK1.3, there shows ResultSet support UPDATABLE, but when i update this ResultSet, all field of current row become empty, when i try rs.updateRow(), it update funny things to my table (Current row).
Using JDK1.4, there shows JVM error and can't get the Symbol of function that cause this error, the point error occu is rs=st.executeQuery("select * from owner")...
:
Is this JDK1.4 bug...???
sim sim
Ranch Hand

Joined: Jun 05, 2002
Posts: 55
Hi Chen,
Though u r using JDBC 2.0 API, the driver and the database should support JDBC 2.0 else 2.0 API dosent work. Did u check whether ur driver and database are 2.0 compatible ?
Sim Sim.
Chen ZhiJiang
Ranch Hand

Joined: May 18, 2002
Posts: 72
Yes. i check it using DatabaseMetaDate properties, it's shows the driver is 2.0001 (Something like this.). Otherwise, it should be complied error when i using ResultSet.TYPE and ResultSet.CON...
Any suggestion, and anybody have the success sample using JDBC API 2.0 that connected to MS Access XP or MySql 4.0.1-alpha-nt
Rudy Dakota
Ranch Hand

Joined: Jul 27, 2002
Posts: 54
Hi there,
I am not sure whether 2.0001 (something) is not just the driver version.
I am pretty sure though that there are a lot of drivers out there that only partially support the JDBC 2.0 specification. One thing I have personally run into (and already posted about today), is drivers that do not correctly implement the combination of updateable and scrollable ResultSets. These drivers tend to silently change the ResultSet into something they can support.
My advice would be to check the driver's documentation about this issue.
Howdy,
Rudy.
m winzenburg
Greenhorn

Joined: Jul 17, 2002
Posts: 8
Can someone explain or be more specific on how to check which version of the driver we are using? Our DBAs don't have a clue, and I'm not aware of any documentation that is available (although I'll do some more checking). We are having a similar problem and not able to use the 2.0 API.
I've located the driver within the java.sql package but don't have any external information on it. Can somebody help?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by m winzenburg:
Can someone explain or be more specific on how to check which version of the driver we are using? Our DBAs don't have a clue, and I'm not aware of any documentation that is available (although I'll do some more checking). We are having a similar problem and not able to use the 2.0 API.
I've located the driver within the java.sql package but don't have any external information on it. Can somebody help?

These DatabaseMetaData methods should help ( if implemented )
int getDriverMajorVersion()
What's this JDBC driver's major version number?
int getDriverMinorVersion()
What's this JDBC driver's minor version number?
String getDriverName()
What's the name of this JDBC driver?
String getDriverVersion()
What's the version of this JDBC driver?
Jamie
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Chen:
if you use the databaseMetaData methods-->
boolean supportsResultSetConcurrency(int type, int concurrency)
Does the database support the concurrency type in combination with the given result set type?
boolean supportsResultSetType(int type)
Does the database support the given result set type?
using the values ResultSet.TYPE_SCROLL_SENSITIVE and ResultSet.CONCUR_UPDATABLE, What does it say?
The next suggestion is to download the latest version of your driver to make sure you have the most efficient and bug-free driver available.
Jamie
m winzenburg
Greenhorn

Joined: Jul 17, 2002
Posts: 8
This worked great and gave me the information that I needed. Thanks, Jamie!
~Mary
 
 
subject: JDBC API 2.0 Help...
 
Similar Threads
creating updatable resultset
Thin Driver for JDBC 2.0
can any one help me how to solve th problem with jdbc driver for DB2
problem with ResultSet.CONCUR_UPDATABLE
updateXXX function of ResultSet ....???