Well first off I'd suggest that you ask your question on a JAVA site and not a PHP site. But since I'm currently working my way through a book on database programming with JAVA I can answer at least 1 of your questions.
- To check if a table exists use a DatabaseMetaData object, that you can get from your Connection object:
DatabaseMetaData dbmd = conn.getDatabaseMetaData();
String[] tableTypes = new String { "TABLE" };
ResultSet tables = dbmd.getTables(null, "APP", null, tableTypes);
while (tables.next()) {
if (tables.getString("TABLE_NAME").equals("MYTABLE")) {
System.out.println("Table Exists");
}
else {
System.out.println("Table Doesn't Exist");
}
}
As for your second question I believe that that is just a matter of choice, and what you want to do with the objects. If you don't need the features of a Vector then just use an array, but if you need certain abilities then you should use the collection object that will give you those features.