Java Reference
In-Depth Information
}
public void execute(String SQLCommand){
String url = urlRoot+dbName;
try {
Connection con = DriverManager.getConnection(url);
Statement stmt = con.createStatement();
stmt.execute(SQLCommand);
con.close();
}
catch(SQLException e){
reportException(e.getMessage());
}
}
public void execute(String[] SQLCommand){
String url = urlRoot+dbName;
try {
Connection con = DriverManager.getConnection(url);
Statement stmt = con.createStatement();
for(int i=0;i<SQLCommand.length;i++){
stmt.execute(SQLCommand[i]);
}
con.close();
}
catch(SQLException e){
reportException(e.getMessage());
}
}
public String[] getColumnNames(String tableName){
Vector dataSet = new Vector();
String[] columnNames = null;
String url = urlRoot+dbName;
String SQLCommand = "SELECT * FROM "+tableName+";";
try {
Search WWH ::




Custom Search