cantene
Apr 18th, 2002, 12:34 AM
Dear friends,
I wish to ask a question.
I wish to write a class Database (function as a wrap-up of JDBC-ODBC database connection) which is public for all other classes to use.
Database.java
public class Database {
}
I write a serlvet class called GetUserInfo which uses an object of type Database as follows:
GetUserInfo.java
public class GetUserInfo extends HttpSerlvet {
private Database db;
init() {
db = new Database(url, user, password);
:
}
:
}
These 2 text files are placed in the same directory.
I first compiled Database.java and created Database.class.
But when I compile GetUserInfo.java, why it blames
"Can't resolve symbol: Database"
Then I go to Control Panel > System to change the CLASSPATH env var to include the full name of the Database.class:
d:\www-root\webapps\Database.class
while my jdk is installed on c: drive c:\jdk.
But the same result!
I saw some program uses package aName at top of all java sources. I think I just need to name them in the same package will be Okay, but the same result! So I wish to know how to use package?
Would you mind helping on this problem? Thanks a lot
Cantene
I wish to ask a question.
I wish to write a class Database (function as a wrap-up of JDBC-ODBC database connection) which is public for all other classes to use.
Database.java
public class Database {
}
I write a serlvet class called GetUserInfo which uses an object of type Database as follows:
GetUserInfo.java
public class GetUserInfo extends HttpSerlvet {
private Database db;
init() {
db = new Database(url, user, password);
:
}
:
}
These 2 text files are placed in the same directory.
I first compiled Database.java and created Database.class.
But when I compile GetUserInfo.java, why it blames
"Can't resolve symbol: Database"
Then I go to Control Panel > System to change the CLASSPATH env var to include the full name of the Database.class:
d:\www-root\webapps\Database.class
while my jdk is installed on c: drive c:\jdk.
But the same result!
I saw some program uses package aName at top of all java sources. I think I just need to name them in the same package will be Okay, but the same result! So I wish to know how to use package?
Would you mind helping on this problem? Thanks a lot
Cantene