Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How create JDBC connection in EcelipseLInk application
How create JDBC connection in EcelipseLInk application [message #909423] Fri, 07 September 2012 05:50 Go to next message
Alex - is currently offline Alex -Friend
Messages: 1
Registered: September 2012
Junior Member
Hello all.

I am try retreive java.sql.Connection in Eclipselink Application running on glassfish.
Connection cnn = ((JpaEntityManager)em.getDelegate()).getServerSession().getAccessor().getConnection();
Connection cnn = ((EntityManagerImpl)(em.getDelegate())).getServerSession().getAccessor().getConnection();
Connection cnn = (Connection) em.unwrap(java.sql.Connection.class);


But in all cases i get cnn == null.

Netbeanse/Ecelipselink v 2.3.3.
Re: How create JDBC connection in EcelipseLInk application [message #911336 is a reply to message #909423] Tue, 11 September 2012 12:17 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The last one is correct. Ensure you first begin a transaction.


James : Wiki : Book : Blog : Twitter
Previous Topic:Constant "Connection closed" errors in new app
Next Topic:Exception handling
Goto Forum:
  


Current Time: Mon Nov 24 01:18:54 GMT 2014

Powered by FUDForum. Page generated in 0.02165 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software