Oracle Database connectivity probem

Ads
 

Oracle Database connectivity probem

hi Below is the code of oracle database connectivity, when i compile it, it will show the error: oracle.jdbc.driver.OracleDriver I am using netbeans 6.5 and tomcat 6.0 and jdk 1.6 i have also set the environment variable like that .;E:\oracle\ora81\jdbc\lib\classes12.zip;E:\oracle\ora81\jdbc\lib\ojdbc14.zip;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;E:\oracle\ora81\jdbc\lib\classes111.zip

I am trying to solve the problem from last three to four week but still not success and still try

Please help me asap. Thanks in advance

package firstexample;

import java.sql.*;

public class FirstExample {

public static void main(String[] args) {
try {
      Class.forName ("oracle.jdbc.driver.OracleDriver");
      Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@//rajesh-4d3ad07c/1521:Rajesh", "scott", "tiger");
      System.out.println("Connected");
      Statement stmt = conn.createStatement();

     // a select query
      ResultSet rset = stmt.executeQuery ("SELECT ename FROM emp");

while (rset.next()) {
System.out.println("ENAME = " + rset.getString(1));
}

rset.close();
stmt.close();
conn.close();

} catch (Exception e) {
System.out.println("ERROR : " + e.getMessage());
}
}
}
View Answers

January 19, 2012 at 6:42 PM

please send the error message what comes and try with the another oracle jar version ojdbc14.jar and put the semicolon at the end of the line in classpath value.

Ads









Related Tutorials/Questions & Answers:
Oracle Database connectivity probem
Oracle Database connectivity probem  hi Below is the code of oracle database connectivity, when i compile it, it will show the error... also set the environment variable like that .;E:\oracle\ora81\jdbc\lib
Database Connectivity Withe Oracle
Database Connectivity Withe Oracle  Develop a program to perform the database driven operation like insert, Delete, Update and select. To perform the above operations create one table named Employee. Field Name Field Type EmpId
Advertisements
oracle connectivity
oracle connectivity  con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","hr","hr"); i have error on above line when i tried...=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","hr","hr
database connectivity
database connectivity  how to create database connectivity between HTML and sql server2005
oracle connectivity problem with netbeans
oracle connectivity problem with netbeans  sir I am using oracle.... for this after adding new driver(ojdbc6.jar) in services tab I got connectivity with oracle... of simple connectivity with oracle in this I am giving driver details
jdbc oracle connectivity problem
jdbc oracle connectivity problem  Hi All, I am trying to connect my swing application to oracle DB . but class.forname is giving error. Please suggest me if there is some different way to connect swing application to oracle
JSP-Oracle connectivity
JSP-Oracle connectivity  I have created a "dynamic web project" mainly with jsp files in eclipse and now, want to connect with oracle 10g, so how can I proceed for the database connection
servelet connectivity with oracle using procedure
servelet connectivity with oracle using procedure   kindly elaborate how servlet code connect to oracle br using procedure
Database Connectivity
Database Connectivity  I tried to establish database connection with sqlserver2008 through GlassFish server. When I set the path of sqljdbc.jar(E:\Glass Fish\glassfish-v2ur1\javadb\lib\sqljdbc.jar) it shows me error
database connectivity
database connectivity  i have written class.forName and getconnection in one method which returns connection string object under particular class and in someother class i want to call that for statement object
database connectivity
database connectivity  i m trying to connect this servlet with database but i m not able to Code is ot giving any error and there is no update in database plsss somebody can help code is here package newpackage; import
database connectivity problem
database connectivity problem  what if client dont have database with them then what is other way to run successfully our programm   Please visit the following link: http://www.roseindia.net/jdbc
storing csv into oracle database
storing csv into oracle database  i want jsp code for storing csv file into oracle database
File insertion into oracle database
File insertion into oracle database  How to Read and Insert a file (any format) into a Oracle database
Database connectivity Hibernate mysql connection.
Database connectivity Hibernate mysql connection.  How to do database connectivity in Hibernate using mysql
Spring and Oracle Database
Spring and Oracle Database  I need example for Batch update process using oracle database and spring framework with full explanation
Access 2007 database connectivity
Access 2007 database connectivity  i design an application form... source and destination. pls tell me the code of connectivity with access 2007 database using JComboBox.thanks
how to solve this problem for oracle connectivity
how to solve this problem for oracle connectivity  Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap ter could not establish the connection
java with Oracle Database
java with Oracle Database  Hello I have been encountering a problem regarding creating a table with Oracle.When i am creating new table in the Database using Oracle , it is giving error saying an errror occured incursive sql
database connectivity using mysql
database connectivity using mysql  java file: eg1.java package eg; import java.sql.*; public class eg1 { public static void main(String arg[]) throws SQLException { try { String connectionURL = "jdbc:mysql
C Program with Database Connectivity
C Program with Database Connectivity  How To Connect MySQL Database in C Program with Graphics
android connection to database oracle 10g
android connection to database oracle 10g  Hello, How i can connect my android application to my oracle 10g database
Jdbc connectivity in java to oracle for retrieving data between two dates
Jdbc connectivity in java to oracle for retrieving data between two dates ... dates from the database table. I am using combo box to get the date. Problem..., while the date that is inserted to the database is in the format of 10/Apr/2012. I
About DataBase Connectivity
About DataBase Connectivity  I want a simple code in which is like two tier application one system have data base and application is running on other system. Pls inform the way hoe to connect both system {I want to run
About DataBase Connectivity
About DataBase Connectivity  I want a simple code in which is like two tier application one system have data base and application is running on other system. Pls inform the way hoe to connect both system {I want to run
Java database connectivity
Java database connectivity  Hi sir I need a code to create an application where user enter name in text box and that should be stored in database. Plz help me out its very urgent.   import java.sql.*; import java.awt.
Oracle 9i database problem
Oracle 9i database problem  Hi Somebody has given the solution but i... Oracle 9i in my laptop.and i got sql+ page ok.i have gone to control panel->odbc->in that i correctley configured DNS and TNS and tested the Oracle
OCI Connectivity For Oracle Plz Solve This Error
OCI Connectivity For Oracle Plz Solve This Error  import java.io.*; import java.sql.*; import java.lang.*; import oracle.jdbc.OracleDriver; public..."); con=DriverManager.getConnection("jdbc:oracle:thin
OCI Connectivity For Oracle Plz Solve This Error
OCI Connectivity For Oracle Plz Solve This Error  import java.io.*; import java.sql.*; import java.lang.*; import oracle.jdbc.OracleDriver; public..."); con=DriverManager.getConnection("jdbc:oracle:thin
Oracle Database - Insert System Time
Oracle Database - Insert System Time  Hi I want to insert only system time dynamically using a statement but not a prepared statement into Oracle Database please suggest me any code
write excel file into the oracle database
write excel file into the oracle database  dear sir, i need the jsp code that reads the excel file and stores it into the oracle database table..and also i need the code to connect oracle database? thank u in advance

Ads