• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to connect to database

 
Kumar sundar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
I have jndi set up for JBOSS server.
I am gettig the below exception:

2008-06-16 13:58:58,950 ERROR [STDERR] com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: RFAPP;SELECT;DA01.BR_PROV_CLAIM_TB
2008-06-16 13:58:58,951 ERROR [STDERR] at com.ibm.db2.jcc.b.id.e(id.java:1640)
2008-06-16 13:58:58,951 ERROR [STDERR] at com.ibm.db2.jcc.b.id.a(id.java:1229)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.b.id.a(id.java:1215)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.c.fb.h(fb.java:142)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.c.fb.a(fb.java:43)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.c.s.a(s.java:30)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.c.wb.g(wb.java:152)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.b.id.n(id.java:1209)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.b.id.a(id.java:1889)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.b.id.a(id.java:517)
2008-06-16 13:58:58,952 ERROR [STDERR] at com.ibm.db2.jcc.b.id.executeQuery(id.java:501)
2008-06-16 13:58:58,952 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:171)

MY JDBC CODE in SERVLET IS AS BELOW:

Connection con2= necon.getConnection();
String st="after cobnnection";
out.println(st);
java.sql.Statement stmt2=con2.createStatement();
st="after stmt";
out.println(st);
java.sql.ResultSet rs=stmt2.executeQuery(sql);
st="after rs";
out.println(st);



String com1="before while";
out.println(com1);
int caseID=0;
String parish="";
String cnslr="";
while(rs.next()){
out.println(com1);
caseID=rs.getInt("CASE_MASTER_ID");
parish=rs.getString("CURRENT_PARISH");
cnslr=rs.getString("CNSLR");
}
out.println(com1);

out.println(caseID);
out.println(parish);
out.println(cnslr);

Dows anybody have any ide about the
org.jboss.resource.adapter.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:171) error in JBOSS
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: RFAPP;SELECT;DA01.BR_PROV_CLAIM_TB


it looks like the error in SQL query to me ?

can you share the query.
 
Kumar sundar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Query is as below:

String sql = "select * from "+necon.getAlias()+".BR_PROV_CLAIM_TB;";

getAlias returns the value DA01.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I did a Google search for "SQLSTATE: 42501", pretty much every link that it returned said something about the authorization ID not having the privilege to do that query.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic