Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

database connection

 
prem kumar vadivelu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to access or insert an value in a particular cell in a database using java code other that SQL.
we can access a column like rs.getString(1) lie this can we access a cell using java code
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to access a column's value other than by submitting a SQL SELECT statement - you need a SELECT to fill the ResultSet.

Once you have the ResultSet and are working your way through the returned rows, you can update column values using the ResultSet.updateXXX(index,value) methods followed by the ResultSet.updateRow() method to commit the changes to the row. You can do a similar thing to insert new rows.

If you don't want to do this low level database handling, us a ORM tool such a Hibernate or JPA to hide these details from you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic