jdbc oracle和mysql连接
oracle
1 private static final String URL = "jdbc:oracle:thin:@localhost:1521:orcl"; 2 private static final String USERNAME = "用户名"; 3 private static final String PWD = "密码"; 4 5 导入驱动Class.forName("oracle.jdbc.OracleDriver");
mysql
1 private static final String URL = "com.mysql.jdbc.Driver"; 2 private static final String USERNAME = "用户名"; 3 private static final String PWD = "密码"; 4 5 导入驱动 6 Class.forName("com.jdbc.msyql.Driver")