Hi,
if this can help you, I used to have a DbAccess class that I used to access
a connection pool independent of JRUN. I modified it in order to use
the JRun connection pool and now my constructor looks like:
<start of code>
public J2EEDbAccess(String poolName)throws Exception {
this.poolName=poolName;
if (ctx==null) ctx = new InitialContext ();
//data source retrieveing
ds=(DataSource)ctx.lookup("java:comp/env/jdbc/"+poolName);
//get connection from data source
try{
con = ds.getConnection();
}catch (Exception e){
con=null;
System.err.println("com.waex.J2EEDbAccess:"+new
java.util.Date()+":caused"+e.getMessage() );
}
.............................
<end of code>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 29, 2002 8:08 PM
> To: JRun-Talk
> Subject: help! Datasource!
>
>
> I am using two ways to access the dabase in my apps.
>
> for the JSP, I'm using the Jrun Data source, and using Jrun tags.
>
> for my java classes, I have one DbAccess() that connects to the
> db, runs a query
> and returns a resultset or status (for updates).
>
> Is it possible to use the DataSource created through the Jrun
> console instead of
> writing my own connection routine?
>
> I found some documentation on using javax.sql.DataSource and
> javax.sql.ConnectionPoolDataSource but don't understand why I
> would need to use
> JNDI. (and how).
>
> Would appreciate to get any kind of clarification or help in this matter.
>
> Thanks,
>
> Zeina
>
>
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists