Bookmark Topic Watch Topic
  • New Topic

ODBC - JDBC connection and Updating MY SQL

 
Hewa Naimanage Sumedha Amalka
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hai, Guys

I am using ODBC and JDBC connection to update my sql database
the connection if fine and the thing is when i run the code in first time in the loop only one record (not all records but i need to all record go to that sql database)gose to sql database.

Second time it shows the exception "primary key , duplicate entry" but i dont want to add that record again (the first one) but it trys do add the database,

And is it is the category is changed it should be up date the category but it also not happens


Guys this is very much needed project to me pls help me !



Yes our management need a updating system so, the excel sheet must be there.
tha's whay i use 2 connections

i can also see there is a mixup in the second result.next() method but i can not correct it

[edited to add code tags]
[ November 16, 2006: Message edited by: Jeanne Boyarsky ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34202
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by Sumedha Amalka:
Second time it shows the exception "primary key , duplicate entry" but i dont want to add that record again (the first one) but it trys do add the database,

Consider using select distinct in the query so all the records are different.

Originally posted by Sumedha Amalka:
And is it is the category is changed it should be up date the category but it also not happens

What are the values that are correct/incorrect?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34202
341
Eclipse IDE Java VI Editor
 
    Bookmark Topic Watch Topic
  • New Topic