How to Make Updates to Updatable Result Sets in JDBC?
Submitted by: AdministratorAnother new feature in the JDBC 2.0 API is the ability to update rows in a result set using methods in the Java programming language rather than having to send an SQL command. But before you can take advantage of this capability, you need to create a ResultSet object that is updatable. In order to do this, you supply the ResultSet constant CONCUR_UPDATABLE to the createStatement method.
E.g.
Connection con = DriverManager.getConnection(”jdbc:mySubprotocol:mySubName”);
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet uprs = (”SELECT COF_NAME, PRICE FROM COFFEES”);
Submitted by: Administrator
E.g.
Connection con = DriverManager.getConnection(”jdbc:mySubprotocol:mySubName”);
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet uprs = (”SELECT COF_NAME, PRICE FROM COFFEES”);
Submitted by: Administrator
Read Online JDBC Job Interview Questions And Answers
Top JDBC Questions
☺ | How can you make the connection using JDBC? |
☺ | How you restrict a user to cut and paste from the html page using JAVA Programing? |
☺ | How to Make Updates to Updatable Result Sets in JDBC? |
☺ | What are the different types of Statements in JDBC? |
☺ | What Class.forName will do while loading drivers of JDBC? |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |