i am trying to insert values into database from excel spreadsheet .am doing it using JDBC.connected both excel and sql database. i have these columns dc:Title,dc:dcid,dc:subject,dc:description,dc:publisher,dc:language in SQL database. in which dc:title will not allow null and dc:dcid is primary key. other attributes can allow null. am trying to insert values from spreadsheet having 4 rows.
statement2.executeUpdate("insert into dbo.Text([dc:Title],[dc:Description],[dc:Publisher]," + "[dc:language],[dc:subject],[CreatedBy])" + " values('"+Cname[i]+"','"+textdescription[i]+"','"+publisher[i]+"','" +language[i]+"','"+Subject[i]+"','"+Createdby[i]+"')");
after each running of the program the above query inserts those 4 rows repeatedly. i want to have unique values means values shouldn't be repeat in the database.
q1. how can i eliminate duplicate values during insertion? please i need code snippet.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.