This error was posted to a DBConnection pooling help desk with no response (we
are using as400.jar which has been replaced by jt400.jar)
When we use jt400.jar instead of the old as400.jar with no changes to the code
(was working) -- the error is java.sql.SQLException: Cursor position not valid.
at com.ibm.as400.access.JDError.throwsSQLException(JDError.java:296)
Can anyone help! (IBM guys??)
Anand Shah wrote:
>
By the way the same errors occur from unix platforms.
Also, how can I improve the initial query access time as it
is in excess of 35 seconds. Subsequent queries are less than 2
seconds until some caching has expired. The as400 people do
not know how to tune the DB2 -- if this is the problem just help
by telling us it is, otherwise tell us that we are missing something
in our code (init maybe -- how to??)
Thanks
Ben
> ------------------------------------------------------------------------
>
> Subject: Problem connecting to AS400 Database
> Date: Fri, 19 May 2000 15:17:10 -0500
> From: Anand Shah <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
>
> Dear Sir,
> My name is Anand Shah, I am working for insurance comapany in Texas. I have
> just come across your site and i downloaded .jar file to use jdbc connection
> pool. I am accessing DB2 database on AS400, i am using
> JDK1.2.2 and am on windows 98 platform. I downloaded
> jdbcpool-0.96.tar.gz file from your site. And befor using connection
> pooling my programme was working fine.
> I am sending you my connection pool code and also code where it stops.
>
> public void init(ServletConfig config) throws ServletException
> {
> super.init(config);
> libraryName = "SISINQDTA";
> Statement stmt = null;
> try
> {
> DriverManager.registerDriver(new
> com.ibm.as400.access.AS400JDBCDriver());
> //pool = new ConnectionPoolManager(300);
> //pool.addAlias("poolalias", "com.ibm.as400.access.AS400JDBCDriver",
> "jdbc:as400://63.75.70.11", "INETINQ", "INQUIRE", 2, 300, 120);
> connection =
> DriverManager.getConnection("jdbc:as400://63.75.70.11","INETINQ","INQUIRE");
>
> //connection =
> DriverManager.getConnection(ConnectionPoolManager.URL_PREFIX+"poolalias",
> null, null);
> }catch(Exception e){
> System.out.println("Error occured during connecting to AS400");
> //System.exit(1);
> }
> }
>
> while (IBPAD_RS.next())
> {
> acccompanyNumber = IBPAD_RS.getString(1);
> accpolicyPrefix = IBPAD_RS.getString(2);
> accpolicyNumber = IBPAD_RS.getString(3);
> accDate = IBPAD_RS.getString(4);
> accrefDate = IBPAD_RS.getString(5);
> accamtTotal = IBPAD_RS.getString(6);
> acceffDate = IBPAD_RS.getString(7);
> accexpDate = IBPAD_RS.getString(8);
> trancodFile = IBPAD_RS.getString(9).trim();
> tranCode = IBPAD_RS.getString(10).trim();
> System.out.print("code "+tranCode);
> if ((trancodFile.equals(CISTTC01)) && (!(tranCode.equals(""))))
>
> {
> String CISTT_SQL = "SELECT CI05DS FROM " +libraryName +
> dmd.getCatalogSeparator() + " CISTTC01 WHERE CI05CD = "+tranCode;
> System.out.println("Querying CISTTC01");
> ResultSet CISTT_RS = statement.executeQuery(CISTT_SQL);
> System.out.println("Pooling results from CISTTC01");
> if (CISTT_RS.next())
> {
> trancodDesc = CISTT_RS.getString(1);
> }
> }
> if ((trancodFile.equals(IBTRCD01)) && (!(tranCode.equals(""))))
>
> {
> String IBTRC_SQL = "SELECT TCTRANDSC FROM " +libraryName +
> dmd.getCatalogSeparator() + " IBTRCD01 WHERE TCTRANCOD =
> '"+tranCode+"'";
> System.out.println("Querying IBTRCD01");
> ResultSet IBTRC_RS = statement1.executeQuery(IBTRC_SQL);
> System.out.println("Pooling results from IBTRCD01");
> if (IBTRC_RS.next())
> {
> trancodDesc1 = IBTRC_RS.getString(1);
> }
> }
> out.println("<TR>");
> for (int i = 1; i <= 1; i++)
> {
> System.out.println("inside");
> out.println("<TD>");
> out.println(acccompanyNumber);
> out.println("</TD>");
> out.println("<TD>");
> out.println(accpolicyPrefix);
> out.println("</TD>");
> out.println("<TD>");
> out.println(accpolicyNumber);
> out.println("</TD>");
> out.println("<TD>");
> out.println(accDate);
> out.println("</TD>");
> out.println("<TD>");
> out.println(accrefDate);
> out.println("</TD>");
> out.println("<TD>");
> out.println(accamtTotal);
> out.println("</TD>");
> out.println("<TD>");
> out.println(acceffDate);
> out.println("</TD>");
> out.println("<TD>");
> out.println(accexpDate);
> out.println("</TD>");
> //if (tranCode.equals(""))
> //{
> out.println("<TD>");
> out.println(tranCode);
> out.println("</TD>");
> //}
> if ((trancodFile.equals(CISTTC01)) &&
> (!(tranCode.equals(""))))
> {
> System.out.println("inside if");
> out.println("<TD>");
> out.println(trancodDesc);
> out.println("</TD>");
> }
> if ((trancodFile.equals(IBTRCD01)) &&
> (!(tranCode.equals(""))))
> {
> out.println("<TD>");
> out.println(trancodDesc1);
> out.println("</TD>");
> }
> }
> out.println("</TR>");
> }
> out.println("</TABLE>");
> out.println("</BODY></HTML>");
>
> All these code is in while loop, so it has to loop through. but it
> stoped at after printing "inside if" on my tomcat window, and after that
> it invokes my exception. without connection pooling i can able to run my
> programme, so i know there is no problem in my code. In my classpath i
> have AS400.jar, IBM.jar and now jdbcpool-0.96.jar file...And i am using
> Apache server and tomcat..
>
> Please help me!
>
> Thanking You
>
> Anand Shah
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html