----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------


Some drivers require you create an instance for the driver to be
registered, eg:

     Class     c;
     Object    o;

     try
     {
          c = Class.forName ( "org.postgresql.Driver"  );
          o = c.newInstance();
     }
     catch( Exception e )
     {
          ...

Otherwise, make sure the PATH and LIBPATH used by JServ are the same as
being used when you run from command-line.

- Fernando




----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

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.





--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]







--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives: 
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to