• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JDBC API 2.0 Help...

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does rs.getConcurrency() print? Could it be a bug with the driver?
 
Chen ZhiJiang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...???
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This worked great and gave me the information that I needed. Thanks, Jamie!
~Mary
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic