• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Format for reading special text from database

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey thanks a lot ulf.. will do the corrections and let you know
 
reply
    Bookmark Topic Watch Topic
  • New Topic