• Post Reply Bookmark Topic Watch Topic
  • New Topic

suggest me the possible ways of doing it?  RSS feed

 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam having different forms releated to student profile(like personal information and contact information) and these forma data will be entered into database..I have done that..
Now apart from that i will get the same data from a file which i have to read and write it into the databse..
For that i have to give them a particular file format so that i can get data in a particular way..so that i can split and store it in databse.
Can any one suggest me some file formats....
what i have done is all the fields in a form ..i wrote on the top of the text file with file separator as ^ and below comes all the student data, but in all there are about 50 fields...writing all this in one row i think it is not the better way..there is every possibility they can escape the special character..
can any one suggest me the better way..

Also one more problem is i have divided the address into 6 fileds i.e
1.Line1
2.Line2
3.city
4.postal code
5.state
6.country
all these data will be sent into one column in the database...
I have mentioned this in the file format as AddressLine1^AddressLine2^AddressCity^AddressState^AddressPostalCode^AddressCountry..
Now tell me how can i frame my file format in a better way so that i can receive the address and all other form data from a college..
Suggest me some ways of doing it...
thanks in advance
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Abhishek Reddy Chepyala:Now apart from that i will get the same data from a file which i have to read and write it into the databse..

Why do you want to repeat the same job from different sources?


Now tell me how can i frame my file format in a better way so that i can receive the address and all other form data from a college..
Suggest me some ways of doing it...


You can do with a .csv file. csv stands for Comma Separated Values. Just google for the same. You can get it.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know who will create that file, but I let my users just use Excel and data could be read in following a ODBC-JDBC bridge.
 
Arundhathi Menon
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An XML structure would be the most structured approach is what I feel. Its a lot more easier to debug and the XML Parser unit that you could write could be made to handle it in a very generic manner.
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arundhathi Menon:
An XML structure would be the most structured approach is what I feel. Its a lot more easier to debug and the XML Parser unit that you could write could be made to handle it in a very generic manner.


Yeah thats true. But as the OP's requirement, if in case of the input file is gonna be too lengthy, then there may be issues in converting the XML structures into Java objects and you may end up in OutOfMemoryError.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!