Skip site navigation (1) Skip section navigation (2)

No SuitableDriver error while inserting through Servlet ,while No error through A Java application

From: Manish Vig <sk(at)pobox(dot)com>
To: java-apache-users(at)list(dot)working-dogs(dot)com
Subject: No SuitableDriver error while inserting through Servlet ,while No error through A Java application
Date: 2000-12-13 23:50:14
Message-ID: 200012131820.XAA17987@tcs.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Dear Sir,

I am trying to run UpdateQuery from a redhatlinux  6.2 server with Apache
Jserv  with PostGres.

When I try a simple Insert statement or a Query statement  from a Java
Applicationit works fine,
But when i try  to do that through a servlet.
It gives me  No Suitable Driver.
I have my PostGreSQL Driver in the ext directory of   jre/lib/ext/

the following code tries to make a connection and inserts the statements


 try  {Class.forName("org.postgresql.Driver");
     				}

	catch(ClassNotFoundException ex){System.err.println(ex.getMessage());}

  		try{

con=DriverManager.getConnection("jdbc:postgresql://localhost/dbname","userna
me","");

                      st= con.createStatement();
			}
		catch(SQLException eft){System.err.println(eft.getMessage());}

	//the error reported here is  No Suitable Driver

  try{


			String stat="INSERT INTO ...."
			System.err.println(stat);st.executeUpdate(stat);

		     }
catch(Exception e){System.err.println(e.getMessage());}
The Error reported here is  Null Pointer Exception


Is there any thing special with the servlet trying to access the PostGresql
jdbc driver.




pgsql-interfaces by date

Next:From: Sanjay AroraDate: 2000-12-14 00:18:41
Subject: Connection Pooling...(Repost)...please do help...
Previous:From: Clark, JoelDate: 2000-12-13 20:19:53
Subject: RE: Connection Pooling...(Repost)...please do help...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group