Ruchita Sheth
Ruchita Sheth

Reputation: 23

can i store text file in java derby database?

I want to store text files in java derby database and then from that data I want to plot some graph can I do that?(the text file contains ASCII data)

Upvotes: 0

Views: 679

Answers (1)

zapping
zapping

Reputation: 4116

You can use one of these 3 methods to store the data

  1. Store the contents of the file into a db column as text. Depending upon the data size either CLOB or the VARCHAR variants can be used.
  2. Store the file as such into the database and use BINARY data type. The file needs to be binary read and stored.
  3. Instead of storing the file or its data into the database just save the file in a folder and insert the filename with path into the database. Then select the filename back from the database and read the contents directly from files the folder.

The graph can be plot according to your requirement and the type of graph directly using java code or a 3rd party library can also be used instead of reinventing the wheel.

Upvotes: 1

Related Questions