|
INTERVIEW QUESTIONS
J2EE
JDBC
DETAILS
Question: How to update a resultset programmatically?
Answer: a. create a scrollable and updatable ResultSet object. Statement stmt = con.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet uprs = stmt.executeQuery("SELECT COLUMN_1, COLUMN_2 FROM TABLE_NAME");
b. move the cursor to the specific position and use related method to update data and then, call updateRow() method. uprs.last(); uprs.updateFloat("COLUMN_2", 25.55);//update last row's data uprs.updateRow();//don't miss this method, otherwise,
|
|
|
Category |
JDBC Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8534 users |
Added on |
9/12/2014 |
Views |
67145 |
Rate it! |
|
|
Question:
How to update a resultset programmatically?
Answer:
a. create a scrollable and updatable ResultSet object. Statement stmt = con.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet uprs = stmt.executeQuery("SELECT COLUMN_1, COLUMN_2 FROM TABLE_NAME");
b. move the cursor to the specific position and use related method to update data and then, call updateRow() method. uprs.last(); uprs.updateFloat("COLUMN_2", 25.55);//update last row's data uprs.updateRow();//don't miss this method, otherwise, Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How to move the cursor in scrollable resultset ?
|
View Answer
|
|
How to move the cursor in scrollable resultset ?
|
View Answer
|
|
What is new in JDBC 2.0?
|
View Answer
|
|
How do I start debugging problems related to the JDBC API?
|
View Answer
|
|
Can the JDBC-ODBC Bridge be used with applets?
|
View Answer
|
|
What's the JDBC 3.0 API?
|
View Answer
|
|
What is JDBC?
|
View Answer
|
|
what is different between tier and 3 tier?
|
View Answer
|
|
What is the difference between a Driver and a DataSource (in Java JDBC)?
|
View Answer
|
|
How can we make objects of connection when connection is an interface.e.g. Connection conn = DriverManager.getConnection ????
|
View Answer
|
|
How to Retrieve Warnings?
|
View Answer
|
|
What are the two major components of JDBC?
|
View Answer
|
|
What are batch updates
|
View Answer
|
|
How can you retrieve data from the ResultSet?
|
View Answer
|
|
How do you implement Connection Pooling
|
View Answer
|
|
What are the steps for connecting to the database using JDBC
|
View Answer
|
|
While in CallableStatament using in the oracle my procedure is return no.of columns so in java
|
View Answer
|
|
How to call a Stored Procedure from JDBC?
|
View Answer
|
|
What Class.forName will do while loading drivers?
|
View Answer
|
|
What packages are used by JDBC?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All JDBC Interview Questions & Answers - Exam Mode /
Learning Mode
|