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!
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 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)
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
I have created a web page which has a form using HTML. I validate the entries made by the user using javascript, and then I read the data entered using doPost method of HttpServlet. Now, I want to store this data in a database. How do I proceed? What new things should I learn? Where does JSP and JDBC SQL come into picture? I am a newbie and trying to learn and implement.
Now I want to store this data in a database. How do I proceed?
You need to learn JDBC, it's an API which provides methods to communicate with the database. SQL [Structure Query Language] is a language which is used to communicate with the database, you write your queries in SQL to extract & insert data to & fro from db. The best resource to start with SQL in opinion would be this.
JSP forms the view of the application. Each thing has its respective role.
Check out the image
This question has some good answers as to how to go about learning Java based web development.
Either way, you have to start with Servlets and as for JSP, architecturally, JSP may be viewed as a high-level abstraction of Java servlets. JSPs are translated into servlets at runtime.
Then and only then move on to web frameworks. This compares different Java web frameworks out there. My personal preference is Spring MVC, it's also the most popular.
Learn what an ORM does and then move on to Hibernate which is an ORM for Java..
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 download a small desktop application.This application stores many information.How they embed database into an application without database setup in computer.I made several search but i don't really understand.
-Are they store this kind of information in txt files?
Thanks in Advance ...
Databases usually thinks in records. If you compare a database table with an Excel spreadsheet that would be a complete row. When you define the database table, you need to tell the database how much space each record will need so it is easy to calculate where any given row number is located simply by multiplying the row number with the space needed for each row.
In the Windows and Linux world most databases are designed to be stand-alone and the various programs needing their services connect with TCP/IP.
Some can also run embedded, where they are part of your application and only service that application which then can fully configure the database. For Java, a typical example is Apache Derby.
You can use sqlite, that is very aprropriate for your purpose.
See http://www.sqlite.org/whentouse.html
There are many ways to save the data. An Application can use simple text files, proprietary binary files or even a full embedded database like SQLite.
For C# there is an easy way like using the application properties, which are automatically saved to disk by the Framework.
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 a web application developed with Java (JSP, Servlets, etc) where I use MySQL as DBMS, take care:
Connection Pool
PreparedStatement
Stored Procedures
-Triggers
My question is how many changes I have to make my application (In addition to changing the name of the driver and the. Jar) for smooth functions with MariaDB.?
Or what considerations should I take for that change?
There is a compability list on MariaDBs pages so you can see that 99% is the same like in MySQL. And from Java perspective, your statements and connection pool should remain the same, however I suppose they can be minor changes in a way how to write stored procedures.
So generally, this transition shouldn't cause any problems but you still want to test this thoroughly in order to be sure that nothing really changed.
MariaDB is a direct fork of the MySQL codebase which hasn't diverged much from it yet. The developers are doing their best to avoid any compatibility-breaking changes to make sure that MariaDB can be used as a drop-in replacement for MySQL. That means switching from MySQL to MariaDB is comparable with updating your MySQL version.
It is unlikely that you will have to make any modifications at your application at all. Still, a proper integration test is definitely in order before migrating the production system, especially when your MySQL version isn't up-to-date.
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
I am making some small "business intelligence" applications/tools that need to talk to other systems. Primarily accounting systems that believe that databases are an integration layer (or are too lazy to provide an api).
What's the easiest way of getting specific data out of a third party database and into my Java objects?
Notes:
(I am now bolding the points below that have not been directly answered)
This is absolutely a read only situation. I would prefer a solution that cannot write.
Depending on speed and/or aggregation requirements, I may want/need to store these records at a future point. (This may or may not impact on solutions like hibernate which would have difficulty reading from one db and writing to another)
The first cut would be a very select partial object population (I have generated my objects from an xml schema, and the database will only need to supply 30% of the possible fields etc)
The first db integration target is (Visual?)FoxPro - hence point 2.
I am currently developing primarily in Java, but expect that to change to scala soonish (can LINQ help here?)
The standard of mapping db schema to objects (and vice versa) is the Java Persistence API. There are several implementation like Hibernate and EclipseLink (and others). I can't tell for all of them, but hibernate an eclipse plugin called hibernate tools, which can generate Java classes from the schema. You can find instructions here
JPA has its own query language called JPQL, Hibernate supports an extended version of it called HQL. Both looks like SQL, applied to objects.
I suggest you take a look at ScalaQuery, if you are doing Scala code.