I encountered this problem in my JSP project:

I need to build two beans in the same "mystore" directory:
"DatabaseConnection" and "InitializeDB":

I already compiled DatabaseConnection.java -> DatabaseConnection.class,
I also included "ClassPath=...\mystore;" in autoexec.bat,

Since these two classes are in the same package,
in InitializeDB I called the previous clas:
DatabaseConnection.createStatement();

when I use javac InitializeDB.java,
the compiler returns error:
"Class mystore.DatabaseConnection not found."

Can anybody tell me what is wrong ? Thanks much.


The two java codes are like these:
----------------------------------------
1. DatabaseConnection.java:

package mystore;
import java.sql.*;
import java.util.*;
public class DatabaseConnection {
    static Connection conn;
    .......
    public static Statement createStatement() throws SQLException {
        if(conn != null)
            return conn.createStatement();
        else
            return null;
    }
   ... ...


2. InitializeDB.java:

package mystore;
import java.util.*;
import java.net.URL;
import java.sql.*;
class InitializeDB {
    private Statement stmt;
    public InitializeDB() throws SQLException {
       stmt = DatabaseConnection.createStatement();
    }
  ... ....









______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to