This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Format for reading special text from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Format for reading special text from database" Watch "Format for reading special text from database" New topic
Author

Format for reading special text from database

Sandeep Swaminathan
Ranch Hand

Joined: Apr 23, 2008
Posts: 52
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?


Music is all around us. All you have to do is just LISTEN to it,
Sandeep Swaminathan
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41128
    
  45
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.


Ping & DNS - my free Android networking tools app
Sandeep Swaminathan
Ranch Hand

Joined: Apr 23, 2008
Posts: 52
hey thanks a lot ulf.. will do the corrections and let you know
 
 
subject: Format for reading special text from database
 
Similar Threads
Selection of datatype for storing images
file name issue
JFileChooser CUSTOM_DIALOG issue
Correctly implementing save with JFileChooser
I have some problem using the JFileChooserDialog.