[jboss-user] [EJB 3.0] - Re: My EJB don't access the database

LeandroSeverino do-not-reply at jboss.com
Tue Nov 6 14:16:55 EST 2007


jaikiran,
  Don't work.

  Strange, but in the stacktrace show-me this lines:
 
  |  at $Proxy105.findAll(Unknown Source)
  |  
  and 
 
  | 15:51:52,990 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
  |  

 I make a test in a servlet:

   
  |         try {
  |             Context c = new InitialContext();
  |             DataSource ds = (DataSource) c.lookup("java:/maragato");
  |             try {
  |                 Connection con = (Connection) ds.getConnection();
  |                 System.out.println(con.isClosed());
  |                 //Properties prop = con.getClientInfo();
  |                 System.out.println(con.getCatalog());
  |                 System.out.println(con.isReadOnly());
  |             } catch (SQLException ex) {
  |                 ex.printStackTrace();
  |             }	
  |         }
  |         catch(NamingException ne) {
  |             Logger.getLogger(getClass().getName()).log(Level.SEVERE,"exception caught" ,ne);
  |             throw new RuntimeException(ne);
  |         }
  |    
  
   and the connection and the datasource is not null.

   I think that the problem is between the JPA and local-tx-datasource, but what is the problem ?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102323#4102323

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102323



More information about the jboss-user mailing list