Код: Выделить всё
OracleConnection.OpenКод: Выделить всё
LocalDateTime startTime=LocalDateTime.now();
Class.forName("oracle.jdbc.driver.OracleDriver");
String connectionUrl="jdbc:oracle:thin:@//192.168.1.100:1521/ORCL";
DriverManager.getConnection(connectionUrl, "TEST_USER", "******");
//java.util.Properties properties = new Properties();
//properties.put("user","DEV_SDSI");
//properties.put("password","Sisd#2023");
//new oracle.jdbc.OracleDriver().connect(connectionUrl, properties);
LocalDateTime endTime=LocalDateTime.now();
System.out.println("elapsed time:"+ Duration.between(startTime, endTime).getSeconds()+"seconds");
Версия Java — JDK 1.8, а версия базы данных Oracle — 11g.
Подробнее здесь: https://stackoverflow.com/questions/798 ... ith-java-j
Мобильная версия