install mysql using java - java

If I have an application that uses a mysql Server to keep its back end database is there a way to bundle the mysql installation with the application installer?
The installer must search if there is an existing mysql server and configure it to work with the application or install mysql and configure it. The target platform is windows.

You can't distribute mysql database according to MySQL license agreement typically:
" MySQL software for your personal applications as long as you do not distribute them"
http://www.mysql.com/about/legal/licensing//commercial-license.html
However, if your application is open source and you have some of kind agreement in terms of distributing the MySql then you can download and package a set of generic binary files on the below link which will allow you to have it available as part of your install package.
MySql Binary package

Related

Can I bundle the Oracle JDBC driver JAR in a Docker image?

I'm building Docker images based on the official Docker Tomcat images, where in addition to Tomcat, I add one of our web applications as a WAR file so it gets deployed when the container starts.
Since the application requires access to a database, and the supported databases use different JDBC drivers and some additional configuration files, I'm building one image per supported database (all based on a common base image), where the image contains the respective database configuration and JDBC driver JAR.
So far, I have done this for MySQL and PostgreSQL, and I'm now looking at support for Oracle.
Since Oracle is a commercial product, and I read somewhere (sorry, no official source) that you're not allowed to bundle the JDBC drivers - what's the best solution for this?
Am I permitted/allowed to bundle the Oracle JDBC driver JAR in a Docker image that I make available to our internal users (not outside of the company)? Or do I have to ask users to download the driver themselves and map it into the image?
When you need an Oracle jdbc driver inside a war, you provide the service for your users without asking Oracle and without asking your users to accept the license, so it should not be different for a Docker image.
Now if you are distributing the driver packaged into your own software (not only the service), I guess Oracle requires you to contact them :
"Can third party vendors distribute Oracle's JDBC drivers along with their own software?
If you are a third party software company (and Oracle partner) then please check out Oracle's licensing terms spelled out at Oracle Licensing Agreement Please contact your local Oracle sales rep for more details."
source : http://www.oracle.com/technetwork/topics/jdbc-faq-090281.html

Java Application Deploying With SQL Server Database

I developed a java swing application by using hibernate connection and MS SQL server for database. Application is working fine. And I know the way to create and EXE and the installer for application.My question is, how I install this application to another computer with database. Should I install the SQL server on that computer or is there any way to use the db without installing the whole SQL server in that computer.
As far as i know there is no way of using database without installing the SQL Server, unless you configure in a way that the application will communicate with the db on your pc, but that's complicated
A different approach to this would be for you to make a view in the database and extract the data you need to a csv file, include that file in the resources folder of the application and then use Lucene to query over it
Take a look at how to get started: here
When you need to update the data in the file you can release updates for the application that would include these changes in the csv file/s

How deploy java derby application for distribution to other clients

I have developed an application which works with derby database, all things are ok on my machine, i started the database server from the netbeans.
Is there any method to copy the database structure and data for distribution to my clients?
All you need to do is to copy the contents of the database folder as is.
The database directory consists usually of one file service.properties and two directories: log and seg0.
If your application is the only one accessing this database on the client, then you should consider to use embedded mode, to avoid the installation of the Derby network server.

embed mysql database in java application

I make a java application using netbeans that connect to database , but i have a problem , i want to embed mysql database with the executable jar file , so when i take this jar file and run it on any pc that doesn't have mysql server it will run with database , i thought about include the mysql-installer.exe and make a script to install the mysql server , but i can't find how to do that ,also i read about Connector/MXJ does it work if the user run the application and he does not have mysql server , any suggestion or article about this.
Derby is a pure-java DBMS. You bundle the derby jar with your program, just as you would any other library. This is a much cleaner way of ensuring your user has a db for your program, as you're not adding any dependencies.
Usually distributors don't include standalone databases, such as MySQL or Oracle, with their
application. If needed, they provide SQL script to build the database and make the user type in the database host, username and password and make a script to build the database. If you want to "ship" the database with your application then I would consider more lightweight databases such SQLite (singe file database).

special driver to connect to sql server 2008 express

I'm a java newbie, want to test out some hibernate goodies!
I have netbeans installed, and I included the Hibernate libraries.
I then created a new package named Model.
I will drop my Class and xml config files in there.
Do I need a special library to connect to sql server? (windows machine)
Yes, you'll need a JDBC library that talks to Microsoft SQL Server. jTDS used to be my first choice but the Microsoft JDBC driver has come a long way and I'd recommend using that. You can download it from this site.
You'll also need to follow these instructions to get the two talking to each other as SQL Server express doesn't listen to TCP by default and uses Windows Authentication Mode.
Have a look at these two URLs for examples of your hibernate.cfg: An explanatory Blog Entry and a JavaRanch Question.

Categories

Resources