• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

jdbc problem with oracle

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
pitt842003 please check your private messages.
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic