wood burning stoves*
The moose likes Servlets and the fly likes Servlet Login Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Login" Watch "Servlet Login" New topic
Author

Servlet Login

Robert Saxxon
Greenhorn

Joined: May 17, 2004
Posts: 2
I am a beginner JSP/Servlet writer and I'm having a problem which is probably simple.

I am trying to create a jsp that uses a servlet to connect to a database and display, if they user is a member, it displays information and if not, it sends them back to the login page.

I am using two java files to do this, one is a servlet (Controller.java) that controls the information between the jsp and the second file (DBConn.java), which connects to the DB and creates an object which has the user info in it, and then returns it to the servlet.

DBConn compiles but Controller does not see the class DBConn. Here is the code for Controller.java



The DBConn source is:


Any ideas?

Thanks
Robert Saxxon
Greenhorn

Joined: May 17, 2004
Posts: 2
btw, the error im getting is:

Controller.java:9: cannot resolve symbol
symbol : class DBConn
location: class shamik.Controller
public DBConn UData = new DBConn();
^
Controller.java:9: cannot resolve symbol
symbol : class DBConn
location: class shamik.Controller
public DBConn UData = new DBConn();
^
2 errors
N S Raju
Greenhorn

Joined: Apr 23, 2004
Posts: 6
Hai

guess ur using command line compilation, just try
java -classpath <DIR> Controller.java

where DIR is the path till the dir where the DBConn.class is located

bye

Surya
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
Controller.java:9: cannot resolve symbol
symbol : class DBConn
location: class shamik.Controller
public DBConn UData = new DBConn();


As you can see it is showing location: class shamik.Controller. You have define the Controller class in shamik package and you are accessing class DBConn which is in sdez package

So use import sdez at the top in definition of Controller class
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Login
 
Similar Threads
update to database problem
Help !!!!!!! Connection problems from you know where!
Setting the attribute
iterate problem in struts2
Solution ------ Cannot create JDBC driver of class '' for connect URL 'null'