import java.sql.*;
class wordtable{
void makedata(String str){
String url = "jdbc:derby:db;create=true";
String usr = "";
String pwd = "";
Connection dbx;
Statement stx;
String sqx;
sqx="create table ";
sqx=sqx+str;
sqx=sqx+" (";
sqx=sqx+"bcode Integer,";
sqx=sqx+"num Integer,";
sqx=sqx+"word varchar(100),";
sqx=sqx+"primary key(bcode,num))";
try {
dbx = DriverManager.getConnection(url, usr, pwd);
stx = dbx.createStatement();
stx.executeUpdate(sqx);
stx.close();
dbx.close();
}
catch (Exception ex) { ex.printStackTrace();}
}
}
最終更新:2011年04月10日 14:21