public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Class.forName("com.mysql.jdbc.Driver");
Enumeration e = DriverManager.getDrivers();
while (e.hasMoreElements()) {
System.out.println(e.nextElement());
}
String url = "jdbc:oracle:thin:@192.168.210.85:1521:ora";
String user = "lian";
String password = "lian";
Connection con1 = DriverManager.getConnection(url, user, password);
Statement sts = con1.createStatement();
sts
.executeUpdate("insert into color(name,age,descr) values('red','0','great color')");
sts.close();
con1.close();
url = "jdbc:mysql:///lian";
Connection con2 = DriverManager.getConnection(url, user, password);
Statement sts2 = con2.createStatement();
sts2
.executeUpdate("insert into color(name,age,descr) values('red','0','great color')");
sts.close();
con2.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}