thanks a lot for the help i tried establishing a connection to my oracle 10g xe database
using the code:
import java.sql.*;
class Connn
{
public void get connection()
{
try{
Class.forName("oracle.jdbc.OracleDriver");
out.println("the driver has been loaded");
Connection con=DriverManager.getConnection("jdbcracle:thin:@acer:1521:xe","system","sys");
out.println("the connection has been established");
Statement stmt=con.createStatement();
int i=stmt.executeUpdate("insert into login values('"+s+"','"+s1+"')");
if(i==1)
{
out.println("data has been inserted into the database");
}
else
{
out.println("data could'nt be inserted into the database");
}
out.close();
do i need to include more jar files in my classpath
That should work then. Check if the jar exists there and add it at the entry at the beginning of the CLASSPATH.
CLASSPATH=C:\oracle\ora101\jdbc\lib\ojdbc14.jar;.;
type CLASSPATH in the cmd to check if your classpath is set right
Can you tell us how do you set this classpath and run the application ? Using any IDE ?
dipayan chatterjee
Ranch Hand
Joined: Oct 03, 2007
Posts: 47
posted
0
hi balu
the jar file ojdbc14 exsists i have also checked the classpath but the problelm still persists . i am using myeclipse 6 workbench
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.