1 package org.apache.ojb.broker; 2 3 17 18 import java.sql.Connection ; 19 import java.sql.SQLException ; 20 import java.sql.Statement ; 21 22 import org.apache.ojb.broker.platforms.Platform; 23 import org.apache.ojb.broker.platforms.PlatformHsqldbImpl; 24 import org.apache.ojb.junit.PBTestCase; 25 26 32 public class HsqldbShutdown extends PBTestCase 33 { 34 public void testHsqldbShutdown() 35 { 36 Platform platform = broker.serviceConnectionManager().getSupportedPlatform(); 37 38 if(platform instanceof PlatformHsqldbImpl) 39 { 40 Connection con = null; 41 Statement stmt = null; 42 43 try 44 { 45 con = broker.serviceConnectionManager().getConnection(); 46 stmt = con.createStatement(); 47 stmt.execute("shutdown"); 48 } 49 catch (Exception e) 50 { 51 e.printStackTrace(); 52 } 53 finally 54 { 55 try 56 { 57 stmt.close(); 58 con.close(); 59 } 60 catch (SQLException e1) 61 { 62 e1.printStackTrace(); 63 } 64 } 65 } 66 67 } 68 } 69 | Popular Tags |