public class OracleJdbcProgram {
public static void main(String args[]){
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
}catch(ClassNotFoundException cnf){
System.out.println("Unable to find the driver class,so unable to load");
cnf.printStackTrace();
}
Connection con=null;
try
{
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:2030:googleea", "system","googleearth");
}catch (SQLException se)
{
System.out.println("Failed to connect to database, check the db server status and try again");
se.printStackTrace();
}
try {
Statement st=con.createStatement();
int i=st.executeUpdate("insert into student values('mehra','Mumbai',18,'1bio02')");
System.out.println("number of rows affected..." +i);
}catch(SQLException sqe){
System.out.println("Failed to excute the query,check the query");
}
}
}
my program doesnt show any errors.. just shows a blank console.... without updating the database??