Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JSP Database Connection problem.

Status
Not open for further replies.

garfield11

IS-IT--Management
Jul 4, 2002
44
SG
Hi all,

I am new in JSP and I'm really stuck on this for a very long time. I have this code to load the jdbc driver :<% Class.forName(SQL.jdbc.driver.SQLDriver); %> but it results in this error. Is it correct to write in this way?

Generated servlet error:
C:\Tomcat4\work\Standalone\localhost\_\dbConnect$jsp.java:67: Undefined variable, class, or package name: SQL
Class.forName(SQL.jdbc.driver.SQLDriver);
^
1 error

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Unknown Source)


Currently using SQL server. So can anyone please help?

Thanks.

Love_Garfield [machinegun]
 
You will need to find a JSP forum for some help. JSP is not related to javascript. There are two or three languages with the word java in it(depending on how you look at it).
They are javascript, java, and jsp (java server page).

Javascript can be divided into two parts:
Client side javascript - this is the most commonly used javascript. It embedded in webpages like html and css. In addition, just like html and css, client side javascript is NOT compiled.
Server side javascript - this is a special version of javascript that is used on servers for the most part and is actually compiled.

Java Java on the other hand is based in no way on javascript. They have different sytaxes and their basic purposes and use. Java can be used to make &quot;real&quot; programs, aka like your word processor and browser. In addition, java is compiled.

JSP (Java Server Page)I am least familiar with this. However I looked up some info on it.
From what I can tell JSP some way relies on Java and is used in a similar manner as ASP (as you probably know). Due to its relation to Java, you might be ablet to ask this question in the java forum. However, if you can find a JSP only forum somewhere, that might be better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top