1 6 package org.logicalcobwebs.proxool; 7 8 import org.apache.commons.logging.Log; 9 import org.apache.commons.logging.LogFactory; 10 import org.apache.commons.logging.impl.SimpleLog; 11 12 import java.sql.DriverManager ; 13 import java.util.Properties ; 14 15 24 public class DependencyCheck { 25 26 30 public static void main(String [] args) { 31 32 try { 33 System.setProperty("org.apache.commons.logging.Log", SimpleLog.class.getName()); 34 System.setProperty(Log.class.getName(), SimpleLog.class.getName()); 35 System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "debug"); 36 37 Log log = LogFactory.getLog(DependencyCheck.class); 38 log.info("Can you read this?"); 39 log.debug("Can you read this?"); 40 Class.forName(ProxoolDriver.class.getName()); 41 String alias = "dependencyCheck"; 42 String url = TestHelper.buildProxoolUrl(alias, 43 TestConstants.HYPERSONIC_DRIVER, 44 TestConstants.HYPERSONIC_TEST_URL); 45 Properties info = new Properties (); 46 info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); 47 info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); 48 DriverManager.getConnection(url, info).close(); 49 System.out.println("Done"); 50 } catch (Throwable e) { 51 if (e instanceof ProxoolException) { 52 e = ((ProxoolException) e).getCause(); 53 } 54 e.printStackTrace(); 55 System.out.println("Fail"); 56 } finally { 57 ProxoolFacade.shutdown(0); 58 } 59 60 } 61 62 } 63 64 79 | Popular Tags |