Re: insert query in ODBC
On Jul 18, 2:46 pm, asit <lipu...@gmail.com> wrote:
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.getConne=
ction("jdbc:odbc: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...