Link to home
Start Free TrialLog in
Avatar of SniperVishal
SniperVishal

asked on

Modify a record using jdbc??

How to modify a record using jdbc??

The method i am using now is:

Display record
Ask user to insert new values.
then update table.

is there a direct way of displaying the record and the user overwrite the data??
Another way??
Avatar of MogalManic
MogalManic
Flag of United States of America image

There is a way, it is called updatable result sets.  Here is Java's tutorial:
http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/makingupdates.html

The only problem with this method is that it usually locks the database for the duration of the tranaction (The transaction lasts until the resultset is closed).  You need to look at your processes and determine the probability of two users accessing the same record at the same time.  If the probabilty is low, then don't worry about it, otherwise check out this thread:
https://www.experts-exchange.com/questions/21107702/Record-Locking.html
Avatar of SniperVishal
SniperVishal

ASKER

i want the a record field to be displayed which the user can modify there itself on the console....

ASKER CERTIFIED SOLUTION
Avatar of MogalManic
MogalManic
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial