File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 39547
    
  27
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 - updated with new look and Ping home screen widget
Sandeep Swaminathan
Ranch Hand

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