/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package telephone;
import java.sql.Connection;
import java.sql.DriverManager;
/**
*
* @author acer
*/
public class MyConnect {
public static Connection getConnection(){
try{
Class.forName(com.mysql.jdbc.Driver.class.getName());
return DriverManager.getConnection("jdbc:mysql://localhost/db_telephone", "root", "root");
}catch(Exception e){
e.printStackTrace();
}
return null;
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น