Changeset 6865
- Timestamp:
- 2004-02-24T11:01:01+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/util/SQLQuery.java
r6516 r6865 17 17 18 18 public boolean setDatabase(String db_name) { 19 connection = GS3SQLConnectionFactory.createConnection(db_name); 20 21 // test the connection 22 String query = "select * from "+GSSQL.DOCUMENT_TABLE+GSSQL.END; 23 if (!connection.execute(query)) { 24 connection = null; 19 try { 20 connection = GS3SQLConnectionFactory.createConnection(db_name); 21 22 // test the connection 23 String query = "select * from "+GSSQL.DOCUMENT_TABLE+GSSQL.END; 24 if (!connection.execute(query)) { 25 connection = null; 26 return false; 27 } 28 return true; 29 } catch (Exception e) { 30 System.err.println("SQLQuery.setDatabase Exception"); 25 31 return false; 26 32 } 27 return true;28 33 } 29 34
Note:
See TracChangeset
for help on using the changeset viewer.