public class process { Connection con; Statement sql; ResultSet rs; //初始化,连接数据库 process() { try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver");//加载驱动 con = DriverManager.getConnection("jdbc:derby:sqm;create=true");//连接名为sqm的数据库 sql = con.createStatement(); rs = con.getMetaData().getTables(null, null, "students", null );//判断students表格是否存在 if(rs.next())//若表格不存在,则建立新表 { sql.execute("create table students(id varchar(20) primary key not null, name varchar(20), score varchar(20))");//创建表 } } catch(Exception e) { System.out.println(e); } } }
只听到从知秋君办公室传来知秋君的声音: 江湖多风波,舟楫恐失坠。有谁来对上联或下联?