Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About JSP error. help me!!!!!

 
Dorj Galaa
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote this code on jsp. but there has error. The error is "Class not found". Then i wrote java application. From java application there has no error. What should i do? Please help me
<%@ page language="java" import="java.sql.*" %>
<% try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc racle:thin:@127.0.0.1 racle","test", "test");}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
 
chetan nain
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why dont you try importing java.io.* and check it out?
the error you got was probable class Connection not found
regds
 
ruijin yang
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you lose the port number 1521.Try to add this number after
127.0.0.1.
ruijin yang

[This message has been edited by ruijin yang (edited July 26, 2001).]
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason that you are getting this is because the class oracle.jdbc.driver.OracleDriver is PROBABLY not in you classpath. Therefore the Class.forName method can not find it to instantiate it.
Rgds
Sam
Originally posted by Dorj Galaa:
I wrote this code on jsp. but there has error. The error is "Class not found". Then i wrote java application. From java application there has no error. What should i do? Please help me
<%@ page language="java" import="java.sql.*" %>
<% try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc racle:thin:@127.0.0.1 racle","test", "test");}
catch(Exception e)
{
out.println(e.getMessage());
}
%>

 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!