insert query in ODBC

A

asit

Why the following code gives error ????

import java.sql.*;

public class Main {

/**
* @param args
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Class.forName("jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:eek:dbc:dsn1",
"scott", "tiger");
Statement stmt = con.createStatement();
int x = stmt.executeUpdate("insert into emp (empno, ename, job)
values (1000, 'asit dhal', 'clerk')");
System.out.println(x + " rows updated");
con.close();

}

}
 
A

asit

Why the following code gives error ????

import java.sql.*;

public class Main {

        /**
         * @param args
         */
        public static void main(String[] args) throws Exception {
                // TODO Auto-generated method stub
                Class.forName("jdbc.odbc.JdbcOdbcDriver");
                Connection con = DriverManager.getConnection("jdbc:eek:dbc:dsn1",
"scott", "tiger");
                Statement stmt = con.createStatement();
                int x = stmt.executeUpdate("insert into emp (empno, ename, job)
values (1000, 'asit dhal', 'clerk')");
                System.out.println(x + " rows updated");
                con.close();

        }

}

Thanx for checking my code.
I have solved this.

sorry for waiting ur time...
 
R

Roedy Green

Why the following code gives error ????

what is the precise wording of the error message?
--
Roedy Green Canadian Mind Products
http://mindprod.com

"For reason that have a lot to do with US Government bureaucracy, we settled on the one issue everyone could agree on, which was weapons of mass destruction."
~ Paul Wolfowitz 2003-06, explaining how the Bush administration sold the Iraq war to a gullible public.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top