}
}
- public Vector getSchemas(Connection con) {
- ResultSet set;
- Vector schemaList = new Vector();
- try {
- DatabaseMetaData meta = con.getMetaData();
- set = meta.getSchemas();
- while (set.next()) {
- schemaList.add(set.getString("TABLE_SCHEM")); //$NON-NLS-1$
- }
- set.close();
- } catch (SQLException e) {
- LogProxy log = LogProxy.getInstance();
- log.addText(LogProxy.ERROR, e);
- }
- return schemaList;
- }
/**
* Makes a connection to a JDBC driver based on the data from a bookmark
* @param bookmark -
bookmark.setPassword(password);
}
}
- Connection con;
+
if (password != null) {
- con = connect(bookmark, password);
+ Connection connection = connect(bookmark, password);
+ if (connection != null) {
+ // Set the autoCommit state of the bookmark to the default on new connections
+ bookmark.setAutoCommit(bookmark.getDefaultAutoCommit());
+ // Set the autoCommit state of the JDBC connection to the bookmark autoCommit statec
+ setAutoCommit(connection, bookmark.isAutoCommit());
+ }
+ return connection;
} else {
return null;
}
- // Set the autoCommit state of the bookmark to the default on new connections
- bookmark.setAutoCommit(bookmark.getDefaultAutoCommit());
- // Set the autoCommit state of the JDBC connection to the bookmark autoCommit statec
- setAutoCommit(con, bookmark.isAutoCommit());
- return con;
}
private Connection connect(Bookmark bookmark, String password)
SQLResults results = new SQLResults();
+ long startTime = System.currentTimeMillis();
System.out.println("Executing"); //$NON-NLS-1$
LogProxy log = LogProxy.getInstance();
log.addText(LogProxy.QUERY, "Executing Request [" + s + "]"); //$NON-NLS-1$ //$NON-NLS-2$
}
log.addText(LogProxy.RESULTS, "Success: result set displayed"); //$NON-NLS-1$
stmt.close();
+ results.setTime(System.currentTimeMillis() - startTime);
System.out.println("Executed"); //$NON-NLS-1$
System.out.println();
return results;