I am developing my project in Java. I would like to know how I can connect to MSAccess.
Any links, or small examples would be greatly appreciated.
Jackcess is a good tool to read MSAccess databases without ODBC.
I've had good luck with using UCanAccess (http://ucanaccess.sourceforge.net/site.html) which allows both read and write access to the database
I used this article, on javaworld when I first started JDBC programming. And may I suggest using pure Java DB's or MySQL's or Oracle's personal editions unless you have a specific need for MS Access.
Related
I am new in Java world. I worked before with .NET environment with MS SQL database, I would like to ask if I can still use MS SQL database with Java? and what tools do I need to proceed with that?
These days, you can use just about any database you want. Microsoft provides JDBC drivers for your use. You can get everything you need here: http://msdn.microsoft.com/en-us/sqlserver/aa937724
This link will allow you to download the JDBC driers an has usage info.
Here's the link to download: http://msdn.microsoft.com/en-us/sqlserver/aa937724
I need to find a suitable database for my application, that satisfy following criteria,
Zero intallation
Zero configuration
Portable (client wants database file to be able to shift from one machine to another manually.)
Please suggest me a suitable database for the above criteria.
For java I will go with Apache Derby (aka Java DB).
I recommend JavaDB, you can use it as an in process database and it has good performance. I have used it in several projects, mainly in Java Swing desktop applications.
I would recommand h2
Sounds like you should use SQLite for that.
Have a look at Java and SQLite for how to interact with the SQLite databae from Java.
for me mongodb also meets these criteria (unless you really need sql database)
Is there a "best" or more popular database for standalone Java app?
I'm currently writing by hand, but I would like to know what is commonly done, if there is something that is commonly done.
update: talking about small app (may grow, but its small for now)
I would suggest using something like SQLite with SQLiteJDBC.
It also sounds like HyperSQL and Derby (which ships with certain Java versions) are popular choices.
Java 6 ships with Derby (renamed JavaDB). It can be used in memory or server mode.
HyperSQL (HSQLDB) is also popular.
For development purposes, I often use the Hypersonic SQL Database (HSQLDB). It's fast and lightweight, and good enough to get started.
For a bigger application, I'd go for Derby, which supports more options.
The main competitors - HyperSQL (HSQLDB), JavaDB (Derby) and SQLite (not java-based) were mentioned.
There are a few other options:
db4o - object database
FirebirdSQL - not java-based.
Jackrabit - a content repository (not RDBMS) supporting embedded mode.
HSQLDB is a well-established option.
JavaDB comes with the development kit
apart all those mentioned here, one can also go for H2 database which is light and can be used in-memory or in server mode.
For a SQL option, you could try MySQL, SQL Server, PostgreSQL, or Oracle. Those seem to be the most popular among Java developers.
If you want something NoSQL, MongoDB is the most popular choice with Java developers based on StackOverflow data from 2022.
You can find more information on the metrics used to make that determination in this article.
How do I establish database connectivity between MySQL and Eclipse Java?
Lots of ways:
Hibernate
EJB (make sure you go with version 3!)
Roll your own solution with JDO/JDBC
And I'm sure there are plenty of other ways to do it as well.
You need a JDBC driver for MySQL in your application classpath which then registers automatically with DriverManager.
You can then use the techniques described in http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html except you need to have the connection string (starting with jdbc:...) adapted to your precise scenario. That is described in the documentation for the JDBC driver you choose to use.
There are plenty of jdbc tutorials if you want to build your own solution. MYsql has a Using MySQL With Java page that has links to tutorials, presentations, blogs etc. The first tutorial looks like it covers everything from installing the database to accessing it from the java program.
Can anyone list the requirements (i.e. any books, tutorials, libraries etc) to build an application in Java, which could communicate with my MySQL Database which is running on web.
I am running an online webstore built in PHP and MySQL. I would like to build a Java Application through which I can (CRUD) Products, Categories, Orders etc.
My Database is already built in MySQL and all the data is present in my online site. So I only need to work on a GUI App which can access my Store's data.
Here is an example application built in Delphi which acts as a Front End (Store Manager) for oscommerce shopping cart.
What technologies do I need for creating Windows GUI in java and Database Application to communicate with my Online Store's Database. ?
I have found some tutorials:
https://web.archive.org/web/20120126005135/http://www.netbeans.org/kb/docs/java/gui-db.html
https://web.archive.org/web/20101125223754/http://www.netbeans.org/kb/docs/java/gui-db-custom.html
https://web.archive.org/web/20090228020221/http://www.netbeans.org/kb/articles/mysql-client.html
https://web.archive.org/web/20110923093326/http://www.netbeans.org/kb/docs/java/gui-db.html
Are the above tutorials enough?
UPDATE:
How about the following books:
1). JDBC Practical Guide for Java Programmers
2). JDBC API Tutorial and Reference, 3rd Edition
Would these be enough for a beginner?
For the database communication you're going to need a JDBC driver for MySql.
Check out the official Sun JDBC tutorial for details on how to use this to access your database.
also Java Swing tutorial or check out SWT if you prefer faster and more native looking UI
Why don't you just use the MySQL tools directly or any Javabased database viewer? If it is only for you you will save quite a bit of time.
DBvisualizer has worked well for me.
http://www.minq.se/products/dbvis/