Changeset 26911 for main/trunk
- Timestamp:
- 2013-02-21T14:01:29+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DerbyWrapper.java
r25856 r26911 87 87 public void closeDatabase() 88 88 { 89 90 conn = null;89 //state = null; 90 //conn = null; 91 91 boolean gotSQLExc = false; 92 92 try 93 { 94 DriverManager.getConnection(protocol_str + ";shutdown=true"); 95 } 93 { 94 // shutdown the database 95 DriverManager.getConnection(protocol_str + ";shutdown=true"); 96 97 } 96 98 catch (SQLException se) 97 99 { 98 gotSQLExc = true; 99 } 100 // this is good (i.e. what Derby is designed to do on a successful shutdown) 101 gotSQLExc = true; 102 } 103 catch (Exception e) { 104 e.printStackTrace(); 105 } 106 100 107 if (!gotSQLExc) 101 108 { 102 System.out.println("Database did not shut down normally"); 103 } 104 } 109 System.err.println("Warning: Derby Database did not shut down normally"); 110 } 111 } 112 113 public static void shutdownDatabaseServer() 114 { 115 boolean gotSQLExc = false; 116 117 try { 118 // shutdown the whole server 119 DriverManager.getConnection(PROTOCOL + ";shutdown=true"); 120 121 } 122 catch (SQLException se) { 123 // this is good (i.e. what Derby is designed to do on a successful shutdown) 124 gotSQLExc = true; 125 //System.out.println("Shutdown returned: " + se); 126 } 127 catch (Exception e) { 128 129 e.printStackTrace(); 130 } 131 if (!gotSQLExc) { 132 System.err.println("Warning: Derby did not shut down normally"); 133 } 134 135 } 105 136 106 137 public void createDatabase()
Note:
See TracChangeset
for help on using the changeset viewer.