I'm trying to use these methods to access a JDBC Connection Pool on my GlassFish 4 server. However, the method at line 16 doesn't compile, because the parameter is invalid (it will only accept a pair of Strings). Am I missing an Oracle library on the build path or is there a new way of doing this in version 4?
01 private static DataSource dataSource;
02
03 static {
04 try {
05 dataSource = (DataSource) new InitialContext().lookup("jdbc/IconLive");
06 } catch (NamingException e) {
07 throw new ExceptionInInitializerError(e);
08 }
09 }
10
11 public static Connection getConnectionWrapper() throws SQLException {
12 return dataSource.getConnection();
13 }
14
15 public static Connection unwrapConnection(Connection connectionWrapper) throws SQLException {
16 return dataSource.getConnection(connectionWrapper);
17 }
18
19 public static void releaseConnection(Connection connectionWrapper) throws SQLException {
20 connectionWrapper.close();
21 }