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 2 years ago.
Improve this question
i am not a pro with programming, and i'm trying to build a desktop app with java, but i need to combine it with sql in order to store a lot of info in a table (database..)
and when i googled i found hours of tutorials to learn sql,
i'm still struggling with java and i have no time to deal with sql too...
can i do this without learn the sql language and all...?
do i have to sit down and study it all or is there another way around?
(p.s. sorry, i think my english not that good...)
Well there's some options:
Use files instead of a database. You can make use of serialization to store your instances directly on files.
Use a non relational database so you won't have to deal with learning SQL
Use an SQL database but search for an ORM. ORMs let you interact with relational databases without typing SQL directly (but you can if you need to when necessary)
Related
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 6 years ago.
Improve this question
I am newbie with database. I have knowledge of java. I am using play framework(java not scala) to develop a web app.
Now for storing informationof users I need to setup a database. As I have no experience with any type of database. I searched and short listed 3.
Mysql
Mongodb
Cassandra
I have seen a lot of examples of implement this database in java project using jdbc. Using there query language. Example: SQL in java.
I don't know any query language. Also I don't want to learn query language and delay the project
After going through the database vendors site. They provide drivers. So my questions are:
Can I use mysql without learning sql. Using driver. Connecting to database to do crud etc without creating schema. With only java. I know other listed database are schema free. So can I do the query in those database also with only java syntax.
When I searched I came to know about hibernate and spring data. Can I connect to database using this framework without the use of query language of those databases.
I wanna know a practical way to connect with those listed database without knowing there query languages.
No, I don't think what you're asking is possible. And if it is possible then I certainly wouldn't recommend it.
Hibernate will shelter you somewhat from having to do basic SQL commands for lookups and updates, however it's not a replacement, you will often have to fall back to HQL and possibly SQL. You really need to understand more about this before you start to use databases, otherwise you'll end up in a mess.
As for it delaying your project, it's better to delay the project than to continue in the dark. After all, time spent learning is never time wasted!
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 7 years ago.
Improve this question
My code is simple, it generates a Data Base to store certain data (obviously), but the problem resides in the fact that it would create an "overflow" of DBs becuase every time the class ran it would generate another Data Base, I heard of a command:
CREATE DATABASE IF NOT EXISTS insertYourFavoriteName;
But some people say that why should I need a DB for each computer, when I could just do a central one when users conect, but correct me if I'm wrong, that would make the app depend on internet, right?
So in resume here are the 2 questions:
Does the command mentioned above works? Or does a better version or way to work around it exists?
Data Bases where all users connect to it mean that you need a server, and as a consecuence your app would depend on internet?
If you want to learn about databases you practice basic CRUD operations on that database. After that do some sample applications on database
If you want to create a database if not exists in mysql simply use this CREATE DATABASE IF NOT EXISTS DBName;
Basically before checking all these things you have to have basic understanding of what is database and how it works, So, please go through some good resources and get good understanding on the concepts.
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 9 years ago.
Improve this question
I have many kinds of db, some are oracle and some are MySQL ,
so when i have an operation about transaction , how can i know which db should be operated.
Have the ways to encapsulate for them to ensure the correct operation ?
what should i do to route these transaction to the correct db ? Do you have any ideas?
Database portability is a great goal to aim for, and is fully achievable for standard & even moderately complex business applications.
Practically, there are two main issues:
1) Some databases (Oracle) have non-standard DDL, especially data-types. This can be converted easily, with search-and-replace.
2) ID/ primary key generation has to be portable; this rules out sequences & auto-generated columns. Use an allocator table instead, which can be completely portable as well as significantly more performant.
Using a persistence layer (such as Hibernate) helps insulate over a few other differences. I've had very good success making even major & complex applications, coming from a major migration and re-engineering project, portable from Oracle to MySQL.
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.
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 9 years ago.
Improve this question
I am currently working on a project in which I am storing the name of program/application window titles and my knowledge of databases and datastores is fairly limited.
The idea is that I want to query the database with a string to see if it is present in the database. I am currently using MongoDB to do this but I have seen that MongoDB is mostly used to be run on a server which isn't what I'm looking for.
My question is - if I am just storing strings / searching for strings would a custom Array or HashMap be sufficient or would search times make it inefficient meaning that SQLite would be more ideal for this situation.
SQLite is perfect for this application. Firefox, for example, uses SQLite for storing its internal configuration settings (the about:config page). SQLite databases are single files, and it can be transparent to the user and requires very little in the way of system resources--unlike most server/client database solutions.
i would suggest to use java preferences api, if the data to be saved is not too much and if it needs to be available even when the application is terminated and restarted.,