Hi, I am Nitish Kumar. I have written the following program of jdbc:
package nitish.jdbc.first;
import java.sql.*;
import java.util.*;
public class JdbcEx1{
public static void main(String []s){
try{
Class c = Class.forName("oracle.jdbc.driver.OracleDriver");
Driver d = (Driver)c.newInstance();
Properties p = new Properties();
p.setProperty("user","scott");
p.setProperty("password","tiger");
Connection con = d.connect("jdbc:oracle:oci8@xe",p);
Statement st = con.createStatement();
String query = "insert into student_details values(1,'Nitish',5000);";
int recordsInserted = st.executeUpdate(query);
System.out.println("Record Inserted::"+ recordInserted);
}//try
catch(ClassNotFoundException cnfe){}
catch(InstantiationException ine){}
catch(IllegalAccessException iae){}
catch(SQLException sqle){}
}//main
}//class
The problem is that I am not getting the output. Means I am unable to connect to the database. When executing this program, it returns nothing. Instead, it should return an integer value. Even I changed the drivers also, but that also didn't help me. I am using Oracle 10g Enterprise Edition release 2. Please suggest me what to do.
Thank you

