aspose file tools*
The moose likes JDBC and the fly likes ODBC - JDBC connection and Updating MY SQL    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

ODBC - JDBC connection and Updating MY SQL

Hewa Naimanage Sumedha Amalka
Greenhorn

Joined: Oct 31, 2006
Posts: 19
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 ]

SCJP 1.4 71%, SCWCD 1.5 84%, SCBCD 90%, SCMAD 98%
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30913
    
158

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?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30913
    
158

See this thread for continuation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ODBC - JDBC connection and Updating MY SQL