You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
755 B
30 lines
755 B
package com.platform.test;
|
|
|
|
import java.sql.Connection;
|
|
import java.sql.DriverManager;
|
|
import java.sql.SQLException;
|
|
|
|
import com.platform.utils.Configs;
|
|
|
|
public class TestConnectOralce {
|
|
|
|
public static void main(String[] args) {
|
|
// TODO Auto-generated method stub
|
|
try{
|
|
Class.forName("oracle.jdbc.driver.OracleDriver");
|
|
Configs.CONSOLE_LOGGER.info("Oracle驱动加载成功");
|
|
}catch(Exception e){
|
|
System.out.println(e);
|
|
}
|
|
String url = "jdbc:oracle:thin:@192.168.0.110:60758:orcl";
|
|
try {
|
|
Connection conn = DriverManager.getConnection(url, "system", "oracle");
|
|
System.out.println("连接成功");
|
|
} catch (SQLException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
}
|