Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc problem with oracle

 
pras
Ranch Hand
Posts: 188
  • 0
  • Mark post as helpful
  • send pies
  • 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("jdbcracle: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??
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pitt842003 please check your private messages.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic