• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

unable to connect to database

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 26776
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic