Problems importing derby drivers in glassfish
===

Good day to everyone,

I'm having some problems making Glassfish 3.1.2 seeing some imported jars. Because this i my grad project i have constraints. I cannot use anything else than Glassfish, Netbeans and i cannot use Maven, Hibernate, Ear or whathever.

I'm working with the embedded Derby driver. (I can use another DB, but in my trials the problem remains).

I've written some plain java code to connect to the DB:

        
        try{
            Connection c   = DriverManager.getConnection(URL, USER, PWD);
            Statement st   = c.createStatement();                
            st.executeUpdate("CREATE TABLE Users" +
                             " (ACCOUNT VARCHAR(20) PRIMARY KEY," +
                             " PWD VARCHAR(20) NOT NULL," +
                             " USERTYPE INTEGER NOT NULL)");
                       
                           ...

           }
           catch (SQLException x){
             System.out.println(x);  
           }

It's ugly, it doesn't use connection pools, it works. I'll use them later.
Obviously i had to add derbyclient.jar to the libs.

The problem arises when i try to use this method inside a servlet:

    protected void processRequest(HttpServletRequest req, HttpServletResponse res)
            throws ServletException, IOException {
                    
        try{           
            DriverManager.registerDriver(org.apache.derby.jdbc.ClientDriver);            
            Connection c = DriverManager.getConnection(dbUsr, pwd, url);            
            Statement st = c.createStatement();            
            ResultSet rs = st.executeQuery(query);

                             ...

           }catch (SQLException e){
            ServletException e1 = new ServletException(e.getMessage());
            throw e1;
        }
I cannot compile the servlet because "Package org.apache.derby.jdbc does not exists".

I can provide some more informations (20+ hours of reading and unsuccesful trials):

 - The servlet and the java code are in the same project, so derbyclient.jar should be seen by both of them.
 - When i write org.apache.berby netbeans shows me the package navigator for auto-completion, so somewhere it knows that there is a jar.
 - I tried to put derbyclient.jar inside:
  - Glassfish/glassfish/domains/domain1/lib
  - Glassfish/glassfish/domains/domain1/lib/ext
  - Glassfish/glassfish/lib
 - Tried without driver registration, the java code works without it, but i get "javax.servlet.ServletException: No suitable driver found for app". I find it reasonable.

I am at my wits end. Does someone care to help?
