测试JDBC连接简单代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement;
public class testOracle {
public static final String URL = "jdbc:oracle:thin:@199.188.166.110:1521:moia"; public static final String USER = "test"; public static final String PASSWORD = "test!@#Ab1C";
public static void main(String[] args) {
try { Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn = DriverManager.getConnection(URL, USER, PASSWORD);
Statement stmt = conn.createStatement(); System.out.println("Succ"); } catch (Exception e) { e.printStackTrace(); }
} }
|
蚂蚁🐜再小也是肉🥩!