1 17 18 21 package org.quartz.utils.weblogic; 22 23 import java.sql.Connection ; 24 import java.sql.SQLException ; 25 26 import org.quartz.utils.ConnectionProvider; 27 28 import weblogic.jdbc.jts.Driver; 29 30 41 public class WeblogicConnectionProvider implements ConnectionProvider { 42 43 50 51 private String poolName; 52 53 private weblogic.jdbc.jts.Driver driver; 54 55 62 63 public WeblogicConnectionProvider(String poolName) { 64 this.poolName = poolName; 65 } 66 67 74 75 public Connection getConnection() throws SQLException { 76 try { 77 if (driver == null) { 78 driver = (Driver)weblogic.jdbc.jts.Driver.class.newInstance(); 79 } 80 81 java.sql.Connection con = null; 82 con = driver.connect("jdbc:weblogic:jts:" + poolName, 83 (java.util.Properties ) null); 84 85 return con; 86 } catch (Exception e) { 87 throw new SQLException ( 88 "Could not get weblogic pool connection with name '" 89 + poolName + "': " + e.getClass().getName() + ": " 90 + e.getMessage()); 91 } 92 } 93 94 public void shutdown() throws SQLException { 95 } 97 } 98 | Popular Tags |