I'm trying to install a couple of things so I can practice querying DB's with JDBC. But even with the copious amount of info I found through Google I'm not convinced I'm clear on what I need. It seems I need the Eclipse SQL Explorer plugin and MySQL 5.6 for Windows. Have I got that correct? And what about the JDBC Driver for MySQL (Connector/J) on the MySQL website?
Do I not need to worry about that when I'm using Eclipse?
you need the following things
mysql database
eclipse IDE
mysql.jar
jdk/jre
Related
I would like to use Derby from apache in order to include database management on a desktop application that I'm currently developing.
Unfortunately I figured out that they have stopped developing this plugin and all the tutorials I've read online refer to this plugin.
So my question is, how can I use the latest version of Derby on eclipse? What steps should I follow? I would like my application to be standalone and easily transferable.
thanks in advance
Apache Derby is just like other databases that provide interface through JDBC. You don't need a specific plugin to connect with Derby. Just use the usual JDBC routines.
Basic steps:
If you want to use the latest Derby version, first you need to download it from here
You need to include the jar in your classpath.
You just need to make connections and perform queries using JDBC, as better explained at the Oracle JDBC Tutorial.
Ditto pram.
I'm using Derby in a Java app I'm developing with Eclipse, and I didn't know there was a plug-in. I connect to Derby like I would to any other database. I use the Derby command-line interface to manage the tables. \
(One feature of other db's I would have liked to see in Derby: having SQL extensions to display db metadata, like MySql's "show" and "describe" commands. Derby has these in the command-line interface, but they're apparently implemented there rather than in the SQL engine itself, so you can't use them outside of the CLI. Bummer. When I'm developing, I often build an ad hoc query screen into the app that lets me type in and execute arbitrary queries. (And no, I don't deploy this to public websites.) But I digress.)
I don't know what the plug-in does for you. I've never used an Eclipse plug-in for any database.
The plug-in is still available in source form, and instructions for building it are available on the Derby website: http://svn.apache.org/viewvc/db/derby/code/trunk/plugins/eclipse/Readme.txt?view=markup
From time to time the instructions for building the plug-in change; you might wish to check into the status of this issue for further updates: https://issues.apache.org/jira/browse/DERBY-5272
Is there any tool in Eclipse comparable with phpMyAdmin? The project is in Java and I want to use H2 database. I have installed DTP but it is not as much user-friendly as phpMyAdmin. I did not find the way to create a table without typing sql query.
Check Quantum plugin for Eclipse. Is a friendly interface to manipulate databases.
Another option is Eclipse SQL Explorer.
you can use squirrel or dbvisualizer. both are two software that use the jdbc to connect on a database, and for dbvisualizer should be an eclipse plugin...
I need a free database for my web app made in Java EE 6. I use glassfish server V3.0.
Could someone recommend me one that is easy to setup and use(for dummies :) )? And also some good instructions.
I just had a horrible experience trying to install MySQL 5.5. It was impossible for me to connect to the database, i was getting all the time a 10061 error, i tried everything and i just gave up. Just please dont tell me MySQL :)
Also i want to mention that i use winXP SP3 and my programming IDE is eclipse Helios
There's little that's easy about Oracle.
I'd recommend PostgreSQL if MySQL won't work for you. It has a very nice admin console, too. You might like that better than the command shell.
Or maybe Derby, the database that's built into JDK 6 and higher.
Or perhaps Hypersonic SQL.
Mysql. :) Seriously, it is THE most popular open source database. Postgres is good too, but Mysql is undoubtedly more popular and you're going to find more hosts that provide you a Mysql database, for instance (if that matters).
Try a Windows LAMP (Linux, Apache, Mysql) package. For instance, try WAMP (http://www.wampserver.com/en/). This will come with phpmyadmin, a pretty good web based admin console for Mysql.
Otherwise, you could try SQL Server Express, a free version of Microsoft SQL Server: http://www.microsoft.com/express/Database/.
Depending on what you're developing for, I'm partial to Oracle Express Edition. It's free, relatively easy to get going, and everything you write against it, will work on an full blown Oracle database. (Since it is basically a full blown Oracle 10g database, just limited).
Note that Glassfish comes with JavaDB (aka DerbyDB) bundled. So you do not need to install any other database (if JavaDB fits your needs)
You can start the database server with the followind command:
glassfish-install/bin/asadmin start-database --dbhome directory-path
See this page for more information.
One thing I love about .NET is the ability to have a database file along with the project. I know that using a SQLite database, this can be done, but did someone achieve this with a MySQL database backend?
So for instance, if I run a java program, it should be able to start its own mini MySQL server and manipulate data. So essentially, I want the same flow as with a SQLite but I need the power of MySQL.
If you don't mind using MariaDB (the open source variant of MySQL, basically works the same) MariaDB4j can be the perfect option for production enviroments.
MariaDB4j is a Java (!) "launcher" for MariaDB (the "backward
compatible, drop-in replacement of the MySQL(R) Database Server", see
FAQ and Wikipedia), allowing you to use MariaDB (MySQL(R)) from Java
without ANY installation / external dependencies. Read again: You do
NOT have to have MariaDB binaries installed on your system to use
MariaDB4j!
As it works completely without any requirements that have to be on the users' pc it is probably the best option to get MySQL embedded. Converting a project that doesn't use an Embedded database into MariaDB4j is as easy as calling:
DB db = DB.newEmbeddedDB(3306);
Read the github page for more information. Maven central dependency is:
<dependency>
<groupId>ch.vorburger.mariaDB4j</groupId>
<artifactId>mariaDB4j</artifactId>
<version>2.2.3</version>
</dependency>
You can combine this with the newest driver to get access to all functionality of MySQL 8.0 (win64/win32=windows, mac64=macos, linux64=linux):
<dependency>
<groupId>org.craftercms.mariaDB4j</groupId>
<artifactId>mariaDB4j-db-win64</artifactId>
<version>10.4.6.2</version>
</dependency>
If you do mind using MariaDB, another option is Wix Embedded MySQL.
Wix Embedded MySQL is a library that provides a way to run real MySql within integration tests.
Why?
Your tests can run on production-like environments: match version, encoding, timezone, database/schema/user settings;
Its easy, much easier than installing right version by hand;
You can use different versions/configuration per project without any local set-up;
Supports multiple platforms: Windows, Linux, and OSX;
Provides constantly updated multiple versions of MySql - 5.5, 5.6, 5.7, 8.0;
Testing matrix for all supported OSes (x86/x64) and versions (5.5, 5.6, 5.7, 8.0).
A quick search shows this: MySQL Connector/MXJ — for embedding MySQL server in Java applications on the MySQL Downloads page at:
http://dev.mysql.com/downloads/
For future reference to anyone looking to embed mysql, there is a utility from the mysql guys that does this http://downloads.mysql.com/archives/c-mxj/
It sounds like you want an embedded database. While MySQL Connector seems nice, it will launch a separate server process. If you want the database server to run in the Java virtual machine, there are several embedded databases for Java.
The two that I've seen used the most are:
Apache Derby / JavaDB
HSQL
I want to write a small (5-6 table) desktop app in Java. I want to use Firebird 2.1. database. But I googled and see HSQLDB. I want to make a decision between Firebird and hsqldb.
So which database I have to use?
Firebird runs in a process of its own and your java app needs to communicate with it. The advantage HSQLDB has that it is written in java, and can run in the same process, which simplifies your installation and runtime check ups (Is the db running, connection errors, etc.). It can persist the data to the disk as well. AN additional option is the H2 database db, which also can run in process.
I'd go with the HSQLDB or H2.
For a desktop application an embedded database should be enough. hsqldb or h2 are very well suited for this. You just have to add the JAR file to you applications classpath. Firebird looks more complex.
Actually, H2 is more advanced than hsqldb.
Firebird is very good embedded database and just win an award at SouceForge this year
SQLite have good press for embedded Database too.
I recomend HSQLDB because it's implemented in Java (so you have the same platform as the application) and I guess that you don't need any of the feature for the project of that size that could FireBird provide.
Don't forget that Java 6 comes with JavaDB, and that may be a useful implementation for a first solution. It's a repackaged Apache Derby, and consequently quite powerful.