Using a Blob to get a file from database [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I'm working on a database project using Oracle Express Edition and using JDBC. I have an excel spreadsheet within the database that I am working with (editing, updating, etc.) I recently started reading about BLOBS, so I just have a general idea about what it is, but I would like to know if it's possible to use the BLOB library in my project in order to download the updated spreadsheet and save it to my computer. I need the updated files saved, and I would prefer if I did it by code. Is this possible, by importing the BLOB class into my project, and if so, how would I go about doing that?

I assume your question relates to this class.
It is important to note that a BLOB is a "Binary Large OBject", and it's a database term used to describe storing arbitrary serialized data into a database. The Java class here allows you to more easily access and modify such an object in a database. It is not referring to the database itself - or the similar spreadsheet you're using.
Your general question (while very broad and likely to get closed) is easily answered; yes. But you'd have to implement several parts:
Download the spreadsheet
Import updates into your database
The class you cite is useful for the latter, but perhaps not the former.

Related

Easy to use database for java project [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am writing a little java application that will handle (potentially) a lot of data on the user's device. The structure of my data is this:
item type 1 contains
integer variable
png/jpeg image
2 string variables
custom datatype containing two strings and a double
list of other items of this type
list of items of type 2 who contain this item
item type 2 contains
string variable
list of items of type 1
I have honestly no idea what I could use to store this data. It should just be easy to add it to the program without requiring too many additional installation steps for the user. What do you think is best?
I would go with H2 Database. Some of the features are:
Very fast, open source, JDBC API
Embedded and server modes; in-memory databases
Browser based Console application
Small footprint: around 2 MB jar file size
Nice documentation and also the creator is active here on Stackoverflow ;-) and can help!
Look here for more: https://www.h2database.com/html/main.html
For starter, you can use SQLite for simple database. But from your story, I think Google Guava suits your needs better.
https://github.com/google/guava/wiki
You may store the data to file before the app exits and load it to memory again when it runs.
Check this one for database-like memory 100% pure Java. http://hsqldb.org/
you could use sqlite as it is a file-based database, it should work great without any installation (just add a library to your project to handle it). https://www.sqlitetutorial.net/sqlite-java/
You should store the images in a folder though

What is the best way to save a lot of links? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am working on a program which gets all links from a website to use them later on. I am using the Java library JSoup to get the links form the website.
My problem is that I don't know where to store all links for later use. Every link has some attributes like "used" or "not used" and the date when it was used. It should also be Windows and Mac compatible. The saved data should be updateable, editable and the program should read the file where the data is saved fast.
Does anyone know a way to solve my problem?
Edit:
As my question wasn't clear for everyone here's a simpler question:
Should I store the links with their attributes in a database or in a file?
If you need to store on a single file I'd go for SQLite. It's a SQL database provider that can save a whole database on a single file. SQLite databases are universally portable.
EDIT: As #bigdestroyer commented, Apache Derby is pure Java and may be another interesting option for you. I haven't used it though, but there is a nice comparison here.

How to maintain database of words in a java dictionary application(other than files) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am developing a java dictionary application...
I used jdbc for maintaining words but i realized that it won't work on other machines since i am making a desktop application...
suggest me a way to maintain words other than files
I don't think there is an alternative to using files if you want to persist your data - it will have to be stored somewhere!
What about the following:
- Use an in memory database that can be persisted to file (h2 for example)
- Use XML persistance - there are plenty of libraries to help.
My suggestion: http://www.manning.com/ingersoll/ :)
And after getting familiar with it, try Solr.
https://lucene.apache.org/solr/
Btw: Please make your question more specific. As this is your first post, I upvoted the question. But think of all the guys around here, who have no knowledge about your problem. Everyone wants to help, but you have to provide more information.
Why not use Embedded Derby?
It's platform independent, uses standard JDBC, and writes files which are accessible across any platform.
http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html
There's no reason why you cannot use JDBC in a standalone java application incidentally. Think of JDBC as a kind of socket you can plug into, but what's behind that socket is entirely implementation specific, and usually can be defined by configuration.
JCR is another good example of this, but this kind of engineering technique is plentiful in the Java universe.

Data storage management [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a task to create a store system. The language that I use to program is Java and the information MUST to be saved in the pc where the program runs.
As far as I know Access does that perfectly when it comes to Visual Basic since I can use the Access interface and edit some cdoe with VB.
Another option I thought of is creating some kind of my own import/export system that will save the information into files and loads them when needed which will require a lot of extra coding.
So what should I do? What is the best way to do that with Java?
The standard way to do it would probably be to use an SQL database such as sqlite or mysql, but it depends a lot on what sort of system you're designing. Options are really,
SQL Database (such as sqlite)
NoSQL Database (such as couchdb)
Object serialization. You could just serialize objects and dump them to files.
Do you need to handle concurrency with multiple programs reading and writing to the database? Do you need low risk of data loss or corruption, or could you sacrifice some data safety for a quick and easy implementation? Do you need to store a lot of data or just some? How fast does it need to be accessed, and is it accessed all at once or do you need to query certain things?
We'd really need answers to all of those questions to be able to give you a good answer for what's best.

GUI for Berkeley DB [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm using Berkeley DB Java edition, via the DPL interface.
I want to ask if someone knows about any GUI library that could make it easy to browse the data saved in the database.
I know that BDB documentation says that the metadata about the stored entities is not saved in any place and therefore only the person who have written the data can know what are the types of the classes that would be returned from there. That's why I'm searching for a library (not a complete program) that would be included to the main project and so it would know the types of my classes and would be able to show the data correctly.
p.s. I've found this bdb-browser but it seems like a dead project.
Update:
So far I've found a GUI that shows the statistics gathered for the BDB via the JMX. Here is how to use it: http://www.oracle.com/technology/documentation/berkeley-db/je/jconsole/JConsole-plugin.html
Still searching for data browser...
You could try DbVisualizer.
DbVisualizer doesn't directly support the Berkeley DB, but does provide JDBC drivers for many databases,
You can use Execute Query to connect Berkeley DB. Its is a free software. You can get the distribution from http://executequery.org
Here is an extremely simple browser. Needs to be compiled though.
https://github.com/ferruccio/bdbvu
I did a quick search and didn't find anything.
I don't think you're going to have a lot of luck looking for a data browser, because the format of the value in each database entry is going to be variable. For example, it might be primitive data, data written out by the default Java serialization, or a custom format for an instance of a class which implements Externalizable.

Categories