• Post Reply Bookmark Topic Watch Topic
  • New Topic

displaying a binary database file  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do I need to use in the Java API to read a binary database file, ie. fileName.db ? Thank you. Mike
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get the value from ResultSet as java.sql.Blob.
For example,

Blob largeFile = rs.getBlob("column_name");
InputStream inputStream = largeFile.getInputStream();

Once you have InputStream with you, then you can read that file anywhere
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch, both of you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!