It is as the title suggest. I want to create a java program in which I will be able to create tables and modify data using Oracle Base/JDBC and I want it to have multiple usage. Sadly when I google "oracle create table", there are only programs which are useless after one usage.
For now I tried something like that, but it is not working as program says the table does not exist.
try{
boolean tableExists;
Statement statement = createStatement();
String sql1 = "SELECT * FROM tableName";
While(statement.execute(sql1)){
tableExists = true;
break;
}
while(tableExists= false){
String sql2 = "CREATE TABLE tableName(id integer not null, name char(10) not null)";
statement.execute(sql2);
tableExists = true;
break;
}
} catch (Exception e) {
e.printStackTrace();
return;
}