aspose file tools
The moose likes JDBC and the fly likes comparing database Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "comparing database" Watch "comparing database" New topic
Author

comparing database

P.Sivaraj
Ranch Hand

Joined: Mar 10, 2005
Posts: 31
Hi All,
I am doing a project using Java Swing in that the user datas will be stored in the MYSQL database through tables. Now that table contents in the database has to be compared with the Same MYSQL database fields. ie if the user is giving the "Name" the name should be in "Char". This should compare wheather the given value is correct according to the fields in the database r not & it has to show the difference if it was there like wise it has to verify all the things present in that table like "Char, Int,VarCahr....."
It is like a Tool to compare the Database values. please help me how to do this one & aswell as in coding also.
Thank you,
P.Sivaraj.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

If you want to use the database constraints as validation you can get at them via java.sql.DatabaseMetaData. As a validation strategy though, its not the best - those constraints are not going to change very often so why add the extra work for every request to query each table for them?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You can write all the table info in some XML file.
Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
once u r getting the value of ur data base
in resultset u can compare it directly using equal() function for string
direct = operator if data of ur database is int and so on..


Amit
University of Florida
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26218
    
  66

Amit,
JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Thanks,
Jeanne
Forum Bartender


[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
Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
ok sir Jeanne Boyarsky
sorry for that.
i will not use shotcuts in future.
bye
take care.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: comparing database
 
Similar Threads
Basic instructions for setting up/running mySQL
Connect to database(mySQL) in a secure way?
Comparing database
database comparison in java
MySQL Case Sensitive Problem