Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Format for reading special text from database

 
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?
 
Rancher
Posts: 43016
76
  • 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
 
permaculture is largely about replacing oil with people. And one tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic