
- #JDBC MYSQL JAVA NO SUITABLE DRIVER FOUND UNIX HOW TO#
- #JDBC MYSQL JAVA NO SUITABLE DRIVER FOUND UNIX MAC OS X#
To create a connection to a database, the code is : conn = DriverManager.getConnection (url, userName, password) Now we will make a class named 'test' and then the main method. To create a java jdbc connection to the database, you must import the following java.sql package. ("\n***** Let terminate the Connection *****") String url = "jdbc:MySQL://localhost/sakila" Ĭonn = DriverManager.getConnection (url, userName, password) ("\n\n***** MySQL JDBC Connection Testing *****") Ĭlass.forName ("").newInstance ()
#JDBC MYSQL JAVA NO SUITABLE DRIVER FOUND UNIX HOW TO#
The following example shows how to connect/terminate and handle errors. Select and download the MSI installer packages from as per your requirement.ĭouble click the installer (here it is "MySQL-connector-java-gpl-5.1.31.msi")Ĭonnecting to MySQL using MySQL Connector/J Install Java Connector on Microsoft Windows In Windows 2000, Windows XP, Windows Server 2003 and Windows Vista, you can set the environment variable through the System Control Panel. Shell> setenv CLASSPATH /path/MySQL-connector-java-ver-bin.jar:$CLASSPATH Shell> export CLASSPATH=/path/MySQL-connector-java-ver-bin.jar:$CLASSPATH You can also set it globally by editing the global /etc/profile file.įor example add the Connector/J driver to your classpath using one of the following forms, depending on your command shell : # Bourne-compatible shell (sh, ksh, bash, zsh):
#JDBC MYSQL JAVA NO SUITABLE DRIVER FOUND UNIX MAC OS X#
You can set the classpath environment variable under Unix, Linux or Mac OS X either locally for a user within their. After extracting the distribution archive, you can install the driver by placing MySQL-connector-java-version-bin.jar in your classpath, either by adding the full path to it to your classpath environment variable or by directly specifying it with the command line switch -cp when starting the JVM. tar.gz archive containing the sources, the class files. Apart from that solution, you manually add the Connector/J location to your Java classpath. The source installation method is important where you want to customize or modifies the installation process or for those platforms where a binary installation package is not available. The binary method is easy which is a bundle of necessary libraries and other files pre-built, with an installer program. You can install the Connector/J package drivers using either the binary, binary installation or source installation. You can download the latest version of MySQL Connector/J binary or source distribution from the following web site -įor Platform Independent select any one from the following :


MySQL Connector/J is the official JDBC driver for MySQL.
