• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Format for reading special text from database

 
Sandeep Swaminathan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a column 'filename' in MySQL which has data in the format '/home/guest/sandeep/project/Sample.txt'. I used the format LONGBLOB to store it in the database. Then my objective was to retrieve it using Java code.



This code is used to store the name of the file to the database.
I got the name of the file in the jtextbox and stored it in the database. I again had to retrieve it using jtable. when i did that filename appeared as [B@1137d4a4

What is the correct format to be used so that if i retrieve it from the database i get it properly done?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
toString() doesn't do what you think it does. Check the API of the File class for methods that return the name of the file; getAbsolutePath is probably the right one.
 
Sandeep Swaminathan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey thanks a lot ulf.. will do the corrections and let you know
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic