Make your own free website on Tripod.com

InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InstantDB: PoolMan and IDB


Hi,
I'm using IDB 3.26 and PoolMan 1.4.1

the following test code causes an error when I try to get the number of
columns from the ResultSetMetaData.
The same code without poolman runs correctly.
Any idea?
Thank you in advance
Massimo

-------------------------------------
error message:
Enhydra InstantDB - Version 3.26
The Initial Developer of the Original Code is Lutris Technologies Inc.
Portions created by Lutris are Copyright (C) 1997-2001 Lutris Technologies,
Inc.
All Rights Reserved.
java.lang.NullPointerException
        at org.enhydra.instantdb.db.Table.getColCount(Table.java:1021)
        at
org.enhydra.instantdb.jdbc.idbResultSetMetaData.getColumnCount(idbResultSetM
eta
Data.java:60)
        at IdbTest.main(IdbTest.java:30)
Database idb is shutting down...
Database idb shutdown complete.

------------------------------------

import java.sql.*;

public class IdbTest {

 public static void log(Object o)
 {
  System.out.println(o!=null?o.toString():null);
 }
 public static void main(String[] args)
 {
  try {
   // idb driver only
/*   String url = "jdbc:idb:D:/db/test_db/idb.prp";
   String driver = "org.enhydra.instantdb.jdbc.idbDriver";
   Class.forName(driver).newInstance();
*/
   // poolman
   String url = "jdbc:poolman://test_db";
   String driver = "com.codestudio.sql.PoolMan";
   Class.forName(driver).newInstance();

   Connection conn = DriverManager.getConnection(url);
   Statement stat = conn.createStatement();
   ResultSet rs = stat.executeQuery("select * from test_table");
   ResultSetMetaData rsmd = rs.getMetaData();

   // ERROR HERE
   log("number of columns: "+rsmd.getColumnCount());

   while(rs.next())
   {
    for (int i=0; i<rsmd.getColumnCount(); ++i)
     log(i+") "+rs.getString(i+1));
   }
   conn.close();

  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}



-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.