Forums Register Login

jdbc problem with oracle

+Pie Number of slices to send: Send
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??
+Pie Number of slices to send: Send
pitt842003 please check your private messages.
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 629 times.
Similar Threads
JDBC
data mismatch error
Could not locate DB driver
Errors Running JSP Page
returning an int
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 22:48:00.