This works. It seems the java interpreter needs
to go up a directory in order to find the "mystore"
package name.
javac -classpath c:\jdk1.2.2\libtools.jar;..; InitializeDB.java
Thanks.
>mystore shouldn't be in the classpath - the directory below it should as
>mystore is part of the package name,
>
>Kevin Jones
>DevelopMentor
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Phillip Fei
Sent: 13 January 2000 18:47
To: [EMAIL PROTECTED]
Subject: Compile Error
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