This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes jdbc problem with oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jdbc problem with oracle" Watch "jdbc problem with oracle" New topic

jdbc problem with oracle

Ranch Hand

Joined: Apr 04, 2007
Posts: 188
public class OracleJdbcProgram {
public static void main(String args[]){

try {

}catch(ClassNotFoundException cnf){
System.out.println("Unable to find the driver class,so unable to load");
Connection con=null;
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");
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

Joined: Apr 14, 2004
Posts: 10336

pitt842003 please check your private messages.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: jdbc problem with oracle
jQuery in Action, 3rd edition