要連線到MySQL必須先有MySQL JDBC的Driver。可以到此下載。String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/accounting";
String user = "howard";
String password = "howardgogogo";
try {
Class.forName(driver);
Connection connection = Driver.Manager.getConnection(url, user, password);
}
catch (ClassNotFoundException ...
...
2008年5月8日 星期四
Java連MySQL
訂閱:
張貼留言 (Atom)
0 意見:
張貼留言