Hi, I am trying to insert the contents of a flat file into table. To connect to database i am using JDBC driver. I the problem i am facing is the contents of flat file is being inserted into table only for the first time when i run the program, again when i try to insert into it( even though table is empty) i am getting an error message.
Can anyone help me in this regard.
Thanks in advance.
program to insert into table:
public void doWork (String s) throws Exception{ String [] ar = s.split("\\-"); try{ Class.forName("oracle.jdbc.driver.OracleDriver"); con = DriverManager.getConnection(url,userName,password); String queryString = "INSERT INTO feeds ( subject,time,creator) values('"+ar[0]+"','"+ar[1]+"','"+ar[2]+"')"; stmt=con.createStatement(); val = stmt.executeUpdate(queryString); } catch(Exception e) { System.out.println("e : " + e); } }
Error message I am getting again when i run the program:
e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver e : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver