| Author |
using java.sql in my own class
|
Lucas Mach
Greenhorn
Joined: Mar 31, 2005
Posts: 15
|
|
I'm writing a JSP page for a course and originally I had a bunch of code in my .jsp files, however, I'm trying to clean it up a bit by making use of Java classes. I made a package for my classes and wrote some functions in one of my classes. Originally, in the .jsp page i was doing: "include java.sql.*" to make use of the sql related functions. After moving all the code into my class I tried to compile the class and i get "cannot resolve symbol" errors for all the java.sql related stuff. Also, i tried to put "include java.sql*" at the top of my class like so: but that doens't work either...what do i have to do to be able to access these java.sql functions in my class?
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24050
|
|
Hi Lucas, In Java source files, you say "import" rather than "include". import java.sql.*; Furthermore, note that your "package" statement has to be the first statement in the file -- the imports have to come after it and before the definition of the class.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Lucas Mach
Greenhorn
Joined: Mar 31, 2005
Posts: 15
|
|
|
doh! can't believe i forgot that! thanks!
|
 |
 |
|
|
subject: using java.sql in my own class
|
|
|