• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with updateXXX() methods

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello group,
I just started working on this project --my first time with databases.
Im connecting to a database using this:
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc dbc:records");
stat = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
res = stat.executeQuery("Select * from records");
res.next();
} 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");
res.updateRow();
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,
Tim
P.S. This Looks like a great site. I hope people check this frequently though because my assignment is due this friday
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic