Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select value$ from props$ where name = 'global_db_name'
- <Context antiResourceLocking="true" crossContext="true" path="/taquillas">
- <Resource auth="Container" driverClassName="oracle.jdbc.OracleDriver"
- factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
- jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
- jmxEnabled="true" url="jdbc:oracle:thin:@yyy.yyy.yyy.yyy:zzzz:ANNI"
- username="xxxxxxxxx" name="jdbc/andrea" password="xxxxxxx"
- type="javax.sql.DataSource" validationInterval="30000"
- maxActive="50" minIdle="1" maxWait="10000" defaultAutoCommit="false"
- initialSize="1" removeAbandonedTimeout="60"
- removeAbandoned="true" validationQuery="SELECT 1 FROM DUAL"/>
- </Context>
- public dbutilsHandler()
- throws ClassNotFoundException, SQLException, NamingException {
- this.gson = new GsonBuilder()
- .setDateFormat("yyyy-MM-dd")
- .serializeNulls().create();
- InitialContext cxt;
- cxt = new InitialContext();
- this.ds = (DataSource) cxt.lookup("java:/comp/env/jdbc/andrea");
- this.query = new QueryRunner(ds);
- this.con = this.query.getDataSource().getConnection();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement