JNDI Datasource in tomcat

Поиск
Список
Период
Сортировка
Искать

JNDI Datasource in tomcat

От:
Gorka Mauleon <gorka.mauleon@openbravo.com>
Дата:
Hi

Im trying to get a connection through a JNDI service in tomcat. Im
trying wuth this config.



using thi driver. pg74.216.jdbc3.jar 
I get this error 
- org.postgresql.util.PSQLException: A result was returned when none was
expected.
- Unable to create a connection pool
org.openbravo.exception.PoolNotFoundException: Failed when creating
database connections pool: org.postgresql.util.PSQLException: A result
was returned when none was expected.

Here
 Context initctx = new InitialContext();
 Context ctx = (Context) initctx.lookup("java:/comp/env");
 DataSource ds = (DataSource) ctx.lookup(jndiResourceName);
con = ds.getConnection();
-- Here i get a org.postgresql.jdbc3.connectionjdbc3
 PreparedStatement pstmt = con.prepareStatement(dbSessionConfig);
pstmt.executeUpdate();  <--- Here a got the error

when i used the driver manager with this driver jdbc3-postgresql.jar i
think that i got another kind of connection and i havent got no error.
seems that now i have a config error but i dont really know whats the
correct way to fix it

can someone help me 

Thanks and regards





Re: JNDI Datasource in tomcat

От:
"Albe Laurenz" <laurenz.albe@wien.gv.at>
Дата:
Gorka Mauleon wrote:
> 
> Im trying to get a connection through a JNDI service in tomcat.

[...]

> using thi driver. pg74.216.jdbc3.jar 
> I get this error 
> - org.postgresql.util.PSQLException: A result was returned when none was
> expected.

[...]

>  PreparedStatement pstmt = con.prepareStatement(dbSessionConfig);
> pstmt.executeUpdate();  <--- Here a got the error
> 
> when i used the driver manager with this driver jdbc3-postgresql.jar i
> think that i got another kind of connection and i havent got no error.
> seems that now i have a config error but i dont really know whats the
> correct way to fix it

What is in "dbSessionConfig"?
That might help answer the question.

BTW, why don't you use a more recent driver?

Yours,
Laurenz Albe
FAQ