package jdbc;
import java.sql.*;
public class ConnectionDemo2 {
public static final String DBDRIVER="com.mysql.jdbc.Driver";
public static final String DBURL="jdbc:mysql://localhost:3306/bizhi" ;
public static final String DBUSER="root";
public static final String DBPASS="admin";
public static void main(String[] args) {
try{
Class.forName(DBDRIVER);
System.out.println("成功连接方法一");
}catch(ClassNotFoundException e){
e.printStackTrace();
}
/*try{
Connection conn=DriverManager.getConnection(DBURL,DBUSER,DBPASS);
System.out.println("成功连接方法二");
}catch(SQLException e){
e.printStackTrace();
}*/
}
}