You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Delia Micu <mi...@icsd.mot.com> on 2000/06/07 21:10:56 UTC

Using JDBC and servlets

I think that someone might have worked with this, and I really need help.

I wrote a "Database" class (part of a package), and in the 'main' I wrote a
small test, which I'm including below:

   public static void main( String[] atgs) throws Exception
   {
	Database db = new Database("jdbc:odbc:ingenius_DJM");
	ResultSet rs = db.executeQuery("SELECT * FROM TSS_ADMIN.EXPORT");
	while( rs.next() )
	{
	   System.out.println( "Contact name = " + rs.getString(7) );
	}
	db.releaseQuery( rs );
   }

When I run this "java Database" it returns the right results.

But I am trying to use this from a servlet, and that part does not work.
The ResultSet returns 'null'.

I don't handle any JDBC classes, and I wonder if I should.  Is there some
special classes or files that need to be under the WEB-INF/lib folder (the
documentation says " ... such as third party class libraries or JDBC
drivers").

Any hits will be greatly appreciated.

Delia