public void createTables() throws SQLException
{
String qs1=ss[0][0];
String qs2=ss[0][1];
Statement stmt;
String q1="CREATE TABLE table1 AS (SELECT PID,:qs1,:qs2 FROM patient)";
System.out.println(" I am Here.....");
String q2="CREATE TABLE table2 AS (SELECT pid,symptom,dateofdiagnosis FROM patient)";
String q3="CREATE TABLE table3 AS (SELECT pid,physician,diagnosismethod FROM patient)";
stmt =conn.createStatement();
System.out.println(" I am Here.....");
//pst1.setString(1,ss[0][0]);
//pst1.setString(2,ss[0][1]);
System.out.println(" I am Here....."+ss[0][0]);
pst2=conn.prepareStatement(q2);
pst3=conn.prepareStatement(q3);
boolean execute = stmt.execute(q1);
pst2.execute();
pst3.execute();
}
我想从上一个表创建一个表,其中列名来自算法