Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2005

Tip: Looking for answers? Try searching our database.

java.lang.ClassNotFoundException: com.pointbase.jdbc.jdbcUniversalDriver

Thread view: 
paul - 15 Jul 2005 13:14 GMT
hi all,

i am new to use servlet, however, i wrote the program below but the
error shown as subject.

import java.sql.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class InventoryServlet extends HttpServlet {
   public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
       String id = req.getParameter("id");
       PrintWriter out = res.getWriter();
       try {
// create a connection

Class.forName("com.pointbase.jdbc.jdbcUniversalDriver").newInstance();
        String url = "jdbc:pointbase:server://localhost/mt811";
        String uid = "pbpublic";
        String pwd = "pbpublic";
        Connection Con = DriverManager.getConnection(url, uid, pwd);
        Statement stm = Con.createStatement();

           String sql = "SELECT * FROM Inventory";
// get the customer info
           ResultSet result = stm.executeQuery(sql);

out.println("<html><head><title>tsting</title></head></html>");
           out.println("<h2>database</h2>");
           while (result.next()) {
//                out.println(result.getString("Name"));
//                out.println(result.getInt("Quantity"));
           out.print(result.getInt("Quantity"));
           out.println(result.getString("InventoryID"));
           out.println(result.getString("Name"));
           }
// Clean up
           result.close();
           stm.close();
           Con.close();

       } catch (Exception e) {
       out.println(e.toString());}
   }
   public void doPost(HttpServletRequest request, HttpServletResponse
response)
   throws IOException, ServletException {
       doGet(request, response);
   }
}

the same driver , login, passwd can be used in another program and
successfully.

pls advise.

paul
theath - 15 Jul 2005 15:51 GMT
where is the jdbc jar relative to your app? on your other program, was
it bundled in there with it, or is your jar in your appserver's lib
directory?
paul - 16 Jul 2005 14:29 GMT
pbclient.jar under the pointbase directory and already set it in my
classpath.
same server ( i use tomcat) , same jdk.
John Currier - 18 Jul 2005 03:07 GMT
As theath indicated the exception is fairly descriptive in what's
wrong: the classloader isn't able to find the class you're trying to
load.  Have you compared the configurations of the two Tomcat servers?
One of them points to an appropriate pbclient.jar...one doesn't.

John
http://schemaspy.sourceforge.net
steve - 31 Jul 2005 02:17 GMT
> hi all,
>
[quoted text clipped - 56 lines]
>
> paul

sloppy very sloppy !!

} finally{
closeports( Con,result, stm);
}

}

 public static void closeports(
   .........) {
       if (.. != null) {
           try {
               ...close();
           } catch (Exception ex) {
         out.println(ex.toString());
           }
       }

       if (... != null) {
           try {
              ...close();
           } catch (Exception ex) {
            out.println(ex.toString());
           }
       }

       if (.....!= null) {
           try {
            ..close();
           } catch (Exception ex) {
            out.println(ex.toString());
           }
       }
   }


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.