import java.sql.*;
public class UseSQL{
public static final String DBDRIVER = "org.gjt.mm.mysql.Driver" ;
public static final String DBURL = "jdbc:mysql://localhodt:3306/student";
public static final String DBUSER = "root";
public static final String DBPASS = "root";
public static void main(String[] args)
{
Connection conn = null;
Statement stmt = null;
try{
Class.forName(DBDRIVER);
}catch(ClassNotFoundException e)
{
e.printStackTrace();
}
try{
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS);
stmt = conn.createStatement();
stmt.executeUpdate("CREATE TABLE stuimfo(id CHAR(30))");
}
catch(SQLException e)
{
e.printStackTrace();
}
try{
stmt.close();
conn.close();
}catch(SQLException e)
{
e.printStackTrace();
}
}
}
榨汁器
最新推荐文章于 2023-11-01 08:28:40 发布