on 09-23-2009 8:14 AM
Hello!
I've set up a datasource and connection pool in my Web AS according http://help.sap.com/saphelp_nw70/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/frameset.htm
And I have some questions about using connection pool:
1) here is my code which get connection form pool:
InitialContext ctx = new InitialContext();
DataSource datasource = (DataSource) ctx.lookup("jdbc/IndexesDataSource");
Connection con = datasource.getConnection();
return con;
Does it properly?
2) Which method I should call when I need to pass connection back to the pool? Will it be enough to call con.close()?
regards, Lev
Hi Lev,
Write code like this
try{
InitialContext ctx=new InitialContext();
DataSource ds=(DataSource)ctx.lookup("jdbc/indexsDataSource");
Connection con=ds.getConnection();
Statement stmt=con.createStatement();
con.close();
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportException("Exception "+e,true);
}
also have a look at below links[Link|http://help.sap.com/saphelp_nw04/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm][Link1|http://help.sap.com/saphelp_nw04/helpdata/en/46/ddc4705e911f43a611840d8decb5f6/frameset.htm][Tutorial|http://help.sap.com/saphelp_nw04/helpdata/en/91/9c2226df76f64fa7783dcaa4534395/frameset.htm]
Regards,
Krishna kattu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I run my WD application, connection pool works fine, but if I run tests, system doesn't use connection pool.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.