mysql:
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost/bbs?user=root&password=root";
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from article");
-------------------------------------------------
oracle:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
Statement stmt = conn.createStatement();
stmt.executeUpdate("insert into emp values (9999, 'YuQiuYu', 'MANAGER', NULL, to_date('2013-03-01','YYYY-MM-DD HH:MI:SS'), 9999, NULL, 10)");