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


Win a copy of Spring in Action this week in the Spring 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: 42280
    
  64
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Format for reading special text from database