• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comparing database

 
P.Sivaraj
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can write all the table info in some XML file.
 
Amit Bathla
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Amit Bathla
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok sir Jeanne Boyarsky
sorry for that.
i will not use shotcuts in future.
bye
take care.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic