Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Barebones UCP connection

ExaGridDba May 5th, 2017 (edited) 115 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. CLASSPATH=ucp.jar:ojdbc6.jar
  2.  
  3. import java.sql.Connection;
  4. import java.sql.SQLException;
  5. import oracle.ucp.jdbc.PoolDataSource;
  6. import oracle.ucp.jdbc.PoolDataSourceFactory;
  7.  
  8. public final class UcpConn
  9. {
  10.         public static void main(String[] args)
  11.                 throws SQLException
  12.         {
  13.                 final PoolDataSource pds = PoolDataSourceFactory.getPoolDataSource();;
  14.  
  15.                 pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
  16.                 final String url = "jdbc:oracle:thin:@//hostname:1521/SVC";
  17.                 pds.setURL( url );
  18.                 final String username = "usr";
  19.                 pds.setUser( username );
  20.                 final String password = "pw";
  21.                 pds.setPassword( password );
  22.                 final Connection conn = pds.getConnection();
  23.         }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top