榨汁器

来源:互联网 发布:mac finder 边栏 编辑:程序博客网 时间:2024/06/11 13:00
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();}}}

原创粉丝点击