users@glassfish.java.net

RE: how to use connection pool with JPA/Toplink implementation in J2EE ?

From: Eve Pokua <gorgeous65_at_msn.com>
Date: Tue, 29 Sep 2009 14:14:57 +0100

Hi,
 
Take a look at this:

 

http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Database Connection Pool (DBCP) Configurations

 

 

  Below is an example of connection to DB . - This' how i used to do it:
 
public class TestDA
{
private static Connection c;


public static void initialize()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

c =DriverManager.getConnection("jdbc:odbc:dbase","","");

}
catch(Exception e)
{
e.printStackTrace();
}
}
public static void terminate()
{
try
{
c.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
 
 
 
You would have to set-up the ODBC in the admin Tools in your control panel.
 
eve

 
> Date: Tue, 29 Sep 2009 05:46:00 -0700
> From: glassfish_at_javadesktop.org
> To: users_at_glassfish.dev.java.net
> Subject: how to use connection pool with JPA/Toplink implementation in J2EE ?
>
> I have J2EE Application where I am using JPA/Toplink now I want to implement external or internal connection pool ... please help me to figure out how to implement connection pooling with JPA/TopLink ... I am using tomcat 6.0 .
> [Message sent by forum member 'bihag' (beehag_at_gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=366184
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>

                                                _________________________________________________________________ With Windows Live, you can organise, edit, and share your photos. http://clk.atdmt.com/UKM/go/134665338/direct/01/