Where can i find mysql connector jar file?

I installed and tried to use jasper report studio. The first brick wall you hit when you try to create a datasource for your reports is

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

The forums say I need to install a jar on the classpath. I have no idea how to do this, so the first hurdle is how to get the jar. The only place I can find is this:

//dev.mysql.com/downloads/connector/j/

but this unfortunately gives you an msi installer, not a jar. I don't want to install stuff, just get the jar.

I have mysql DB installed, had have trawled through the install dir in program files, but can't find the jar.

Anyone know the official [not malware site] way to get hold of the mysql jar? It seems bizarre that its so hard to find.

I have windows 8 64 bit and mysql 5.6.

Caution

You need to install Connector/J from source only if you want to build a customized version of Connector/J or if you are interested in helping us test our new code. To just get MySQL Connector/J up and running on your system, install Connector/J using a standard binary release distribution; see Section 4.1, “Installing Connector/J from a Binary Distribution” for instructions.

To install MySQL Connector/J from source, make sure that you have the following software on your system:

Tip

It is suggested that the latest versions available for the following software be used for compiling Connector/J; otherwise, some features might not be available.

  • A Git client, if you want to check out the sources from our GitHub repository [available from //git-scm.com/downloads].

  • Apache Ant version 1.10.6 or newer [available from //ant.apache.org/].

  • JDK 1.8.x [available from //www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html].

  • The following third-party libraries:

    • JUnit 5.6 [see installation and download information in the JUnit 5 User Guide]. The following JAR files are required:

      • junit-jupiter-api-5.8.2.jar [available from, for example, //search.maven.org/artifact/org.junit.jupiter/junit-jupiter-api/5.8.2/jar].

      • junit-jupiter-engine-5.8.2.jar [available from, for example, //search.maven.org/artifact/org.junit.jupiter/junit-jupiter-engine/5.8.2/jar].

      • junit-platform-commons-1.8.2.jar [available from, for example, //search.maven.org/artifact/org.junit.platform/junit-platform-commons/1.8.2/jar].

      • junit-platform-engine-1.8.2.jar [available from, for example, //search.maven.org/artifact/org.junit.platform/junit-platform-engine/1.8.2/jar].

      • junit-platform-launcher-1.8.2.jar [available from, for example, //search.maven.org/artifact/org.junit.platform/junit-platform-launcher/1.8.2/jar].

      • These additional JAR files, which JUnit 5 depends on:

        • apiguardian-api-1.1.2.jar [available from, for example, //search.maven.org/artifact/org.apiguardian/apiguardian-api/1.1.2/jar].

        • opentest4j-1.2.0.jar [available from, for example, //search.maven.org/artifact/org.opentest4j/opentest4j/1.2.0/jar].

    • Javassist 3.28.0 [javassist 3.28.0-GA.jar, available from, for example, //search.maven.org/artifact/org.javassist/javassist/3.28.0-GA/bundle].

    • Protocol Buffers Java API 3.19.4 [protobuf-java-3.19.4.jar, available from, for example, //search.maven.org/artifact/com.google.protobuf/protobuf-java/3.19.4/bundle].

    • Simple Logging Facade API 1.7.35 or newer [slf4j-api-1.7.35.jar, available from, for example, //search.maven.org/artifact/org.slf4j/slf4j-api/1.7.35/jar].

    • Java Hamcrest 2.2 or newer [hamcrest-2.2.jar, available from, for example, //search.maven.org/artifact/org.hamcrest/hamcrest/2.2/jar].

    • Oracle Cloud Infrastructure SDK for Java [oci-java-sdk-common-2.14.1.jar, available from, for example, //search.maven.org/artifact/com.oracle.oci.sdk/oci-java-sdk-common/2.14.1/jar].

To build MySQL Connector/J from source, follow these steps:

  1. Make sure that you have JDK 1.8.x installed.

  2. Obtain the sources for Connector/J by one of the following means:

    • Download the platform independent distribution archive [in .tar.gz or .zip format] for Connector/J, which contains the sources, from the Connector/J Download page. Extract contents of the archive into a folder named, for example, mysql-connector-j.

    • Download a source RPM package for Connector/J from Connector/J Download page and install it.

    • Check out the code from the source code repository for MySQL Connector/J located on GitHub at //github.com/mysql/mysql-connector-j. The latest release of the Connector/J 8.0 series is on the release/8.0 branch; use the following command to check it out:

      $> git clone --branch release/8.0 //github.com/mysql/mysql-connector-j.git

      Under the current directory, the command creates a mysql-connector-j subdirectory , which contains the code you want.

  3. Place all the required third-party libraries in a the directory called lib at the root of the source tree [that is, in mysql-connector-j/lib, if you have followed the steps above], or put them elsewhere and supply the location to Ant later [see Step 5 below].

  4. Change your current working directory to the mysql-connector-j directory created in step 2 above.

  5. In the directory, create a file named build.properties to indicate to Ant the location of the root directory for your JDK 1.8.x installation with the property com.mysql.cj.build.jdk, as well as the location for the extra libraries, if they are not in mysql-connector-j/lib, with the property com.mysql.cj.extra.libs. Here is a sample file with those properties set [replace the path_to_* parts with the appropriate file paths]:

    com.mysql.cj.build.jdk=path_to_jdk_1.8
    com.mysql.cj.extra.libs=path_to_folder_for_extra_libraries

    Alternatively, you can set the values of those properties through the Ant -D options.

  6. Issue the following command to compile the driver and create a .jar file for Connector/J:

    $> ant dist

    This creates a build directory in the current directory, where all the build output goes. A directory is created under the build directory, whose name includes the version number of the release you are building. That directory contains the sources, the compiled .class files, and a .jar file for deployment.

    For information on all the build targets, including those that create a fully packaged distribution, issue the following command:

    $> ant -projecthelp
  7. Install the newly created .jar file for the JDBC driver as you would install a binary .jar file you download from MySQL by following the instructions given in Configuring the CLASSPATH or Configuring Connector/J for Application Servers.


What is MySQL Connector jar file?

MySQL Connector/J is the official JDBC driver for MySQL. MySQL Connector/J 8.0 is compatible with all MySQL versions starting with MySQL 5.6. Additionally, MySQL Connector/J 8.0 supports the new X DevAPI for development with MySQL Server 8.0. Online Documentation: MySQL Connector/J Installation Instructions.

Where is MySQL Connector jar file in Linux?

Once it's installed, you'll have the file /usr/share/java/mysql. jar , which is an indirect symlink to the actual jar file. Alternatively, install the mysql-apt-config package, update, and you'll be able to install all currently supported MySQL software with apt .

Where can I find MySQL JDBC driver?

Download the driver.
Navigate to the MySQL Community Downloads website..
Click the Archives tab..
Click the Product Version drop-down menu and select 5.1. ... .
Download the ZIP archive [for Windows] or TAR archive [for Linux and macOS]..
Unpack the archive file using WinZIP [for Windows] or another utility..

How do I download MySQL JDBC connector?

Connect to MySql using DbSchema Free Edition.
1 Select an Alias for your database connection. This will be the name of this specific connection to the database..
2 Select 'MySql' from the list of DBMS [Database Management Systems]..
3 The driver for your database will be automatically downloaded for you in the folder..

Chủ Đề