File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes problem with updateXXX() methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "problem with updateXXX() methods" Watch "problem with updateXXX() methods" New topic

problem with updateXXX() methods

Tim Hysniu

Joined: Dec 01, 2003
Posts: 1
Hello group,
I just started working on this project --my first time with databases.
Im connecting to a database using this:
try {
conn = DriverManager.getConnection("jdbc dbc:records");
stat = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
res = stat.executeQuery("Select * from records");;
} catch(Exception e) {
System.out.println("Error " + e);
Reading the everything using getXXX() methods works great. I'm having problems with writing to the database.
// column 1 in database is String
res.updateString(1, "Some string");
looks like updateString() and all updateXXX() are not doing anything.
updateRow() then, I believe, gives me an error msg:
"[Microsoft][ODBC Microsoft Access Driver]Error in row"
what am I doing wrong here? Error in row???
All I want is read and write on each row from a single table. No complexity is needed in my program. Can tell me what does this error mean and how do I fix it?
Thanks Very much,
P.S. This Looks like a great site. I hope people check this frequently though because my assignment is due this friday
Anurag Gupta
Ranch Hand

Joined: Dec 13, 2001
Posts: 40
The JDBC Specs may or may not be FULLY implemented by all the Database driver vendors - hence the issue.
It would be better to stick to the standard/basic functions to avoid such PitFalls.
I would use 2 Queries :
One to select the Records. Other to update the Record.
The question may arise on the Application Performance. But If your Database is designed correctly, there would not be much performance impact. Its a trade off between Vendor Independent Code and Performance.

Anurag Gupta
I agree. Here's the link:
subject: problem with updateXXX() methods
It's not a secret anymore!