Advertisement
Guest User

Untitled

a guest
May 26th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. public class TestCase {
  4.     public static void main(String args[]){
  5.         Connection connection;
  6.         String stringConnection;
  7.         Statement stmt;
  8.         ResultSet rs;
  9.         try {
  10.             Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
  11.             stringConnection = "jdbc:oracle:thin:@localhost:1521:xe";
  12.             connection = DriverManager.getConnection(stringConnection, "lbd", "lbd");
  13.             stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
  14.  
  15.             rs = stmt.executeQuery("SELECT * FROM PERSONA");
  16.  
  17.             System.out.println(rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE); //FALSE!!!
  18.  
  19.             rs.close();
  20.             stmt.close();
  21.         }
  22.         catch (Exception e){
  23.             e.printStackTrace();
  24.         }
  25.     }
  26. }
  27.  
  28.  
  29. $ javac TestCase.java
  30. $ java -cp .:ojdbc14.jar TestCase
  31. false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement