Help registering driver mysql-connector-j

Error: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Hello Everyone, I keep on getting a java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
exception when I attempt to register the mysql-connector-j.
I'm just using the code from it's documentation:
public class LoadDriver {
public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
System.out.println(ex);
I have a CLASSPATH 'user' variable containing...
C:\JavaStuff; C:\mysql-connector-java-3.1.1-alpha\mysql-connector-java-3.1.1-alpha-bin.jar
Where JavaStuff is the location of the LoadDriver class. I have to fix this thing as soon as possible as I'm currently working on a project. Much help will be apprecieated. I have a feeling it may be somthing to do with the classpath!

It is the classpath.
Do you really have a space after c:\javastuff? (You shouldn't.)
Is that really the path to the jar file? And does that jar file really contain the driver class?
I assume you are asking in the context of a Java application, which uses the CLASSPATH environment variable. Other possibilities (servlets, applets, executable jar files) have other ways of finding classes.

Similar Messages

  • Fat Jar Export: Could not find class-path entry for 'C:Java/jdk/mysql-connector-java-

    ok friends,
    have a normaly running project in eclipse and want to create a jar file...i tried ewerythin in ->export but nothing function
    i wanted to create a runnable jar file but that error ecures:
    JAR export finished with warnings. See details for additional information.
    Exported with compile warnings: ICQJJ/src/ICQJJ.java
    Jar export finished with problems. See details for additional infos.
    Fat Jar Export: Could not find class-path entry for 'C:Java/jdk/mysql-connector-java-5.1.8-bin.jar'
    what's the problem?
    ok, i am using a mysql db und using the driver mysql-connector-java-5.1.8-bin.jar....
    i improted this jar file like this run -> run configuration -> classpath -> add external jar....
    pls help me

    That looks like it might be a binary-distribution JAR that you should unjar. The actual JAR for the classpath is probably inside it.

  • Driver MySQL How to find the good ?

    Hello,
    I have a problem with my MySQL driver:
    -> java.sql.SQLException: Communication link failure: java.io.EOFException
    This problem occured only on one of our Linux OS , then I think that I didn't choose the good driver....
    How to know what driver to choose ?
    I serached on http://developers.sun.com/product/jdbc/drivers but I don't understand very well how to use it.
    Details of my environment:
    - MySQL ver 12.18 Distrib 4.0.12, for pc-linux (i686)
    - OS: Pentium 2.8GHz 2 giga RAM -> Linux 2.4.20-20.7 i686
    - java 1.4.1_02
    - JDBC driver: MySQL Connector/J 3.0.16-ga
    Mysql Database and java process are on the same machine.
    The java soft does only SELECT queries.
    Thanks to help me
    Ludovic Maillet

    This problem occured only on one of our Linux OS , then I think that I didn't choose the good driver....But the problem does not occur on other Linux OS's? Then you must think that the driver there is the good one. Use that driver.

  • "No suitable driver" error using Kodo 3.1.0, MySQL Connector/J & eclipse 3.0M8

    Hi,
    I'm getting the following error when trying to use the mapping tool from
    within eclipse 3.0M8:
    <error>-An error occurred running MappingTool
    kodo.util.FatalDataStoreException: No suitable driver
    NestedThrowables:
    java.sql.SQLException: No suitable driver
    <info>-Done.
    I followed the instructions on using the eclipse plugin, including copying
    all jars from kodo's lib folder to the plugin folder, copying the MySQL
    Connector/J jar to the kodo plugin folder, adding all of those jars to the
    project classpath, and even added an entry to the plugin.xml file to
    include the MySQL Connector/J jar. If I remove the project reference to
    the MySQL Connector/J jar, the error changes to:
    <error>-An error occurred running MappingTool
    kodo.util.FatalDataStoreException: com.mysql.jdbc.Driver
    NestedThrowables:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    <info>-Done.
    This would imply that adding a <library> entry for the MySQL Connector/J
    jar in my plugin.xml does not have any effect; if I remove it, I see the
    same error as above. If I add the MySQL jar back to the project
    classpath, the error changes back to 'No suitable driver' as above.
    The behavior is the same whether I use the Kodo preferences
    (Window\Preferences\Kodo Preferences) individually without a
    kodo.properties file, or when I clear all individual properties and
    indicate a kodo.properties file.
    Help?
    Thanks,
    Matthew
    Here's my kodo.properties file:
    # Kodo JDO Properties configuration
    kodo.LicenseKey: xxx
    javax.jdo.PersistenceManagerFactoryClass:
    kodo.jdbc.runtime.JDBCPersistenceManagerFactory
    javax.jdo.option.ConnectionDriverName: com.mysql.jdbc.Driver
    javax.jdo.option.ConnectionUserName: root
    javax.jdo.option.ConnectionPassword:
    javax.jdo.option.ConnectionURL: jdbc:mysql://localhost/kodo
    javax.jdo.option.Optimistic: true
    javax.jdo.option.RetainValues: true
    javax.jdo.option.NontransactionalRead: true
    kodo.Log: DefaultLevel=WARN, Runtime=INFO, Tool=INFO
    Here's my eclipse-3.0M8/plugins/kodo.eclipse_2.1.0/plugin.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <plugin id="kodo"
    name="%name"
    version="1.0.1"
    provider-name="%provider-name"
    class="kodo.jdbc.integration.eclipse.KodoPlugin">
    <runtime>
    <!--
    Put your jdbc driver in this directory and enter the filename
    here (and configure in Preferences the changes you make) -->
    <!--<library name="jdbc-hsql-1_7_0.jar"/>-->
    <library name="mysql-connector-java-3.0.11-stable-bin.jar"/>
    <!-- ########### do not modify below ######### -->
    <!-- ########### do not modify below ######### -->
    <!-- ########### do not modify below ######### -->
    <!-- ########### do not modify below ######### -->
    <!-- ########### do not modify below ######### -->
    <library name="kodo-jdo.jar"/>
    <library name="jakarta-commons-collections-2.1.jar"/>
    <library name="jakarta-commons-lang-1.0.1.jar"/>
    <library name="jakarta-commons-pool-1.0.1.jar"/>
    <library name="jakarta-regexp-1.1.jar"/>
    <library name="jca1.0.jar"/>
    <library name="jdbc2_0-stdext.jar"/>
    <library name="jdo-1.0.1.jar"/>
    <library name="jta-spec1_0_1.jar"/>
    <library name="xalan.jar"/>
    <library name="xercesImpl.jar"/>
    <library name="xml-apis.jar"/>
    <library name="jfreechart-0.9.16.jar"/>
    <library name="jcommon-0.9.1.jar"/>
    <library name="mx4j-admb.jar"/>
    <library name="mx4j-jmx.jar"/>
    <library name="mx4j-tools.jar"/>
    <library name="jline.jar"/>
    <library name="sqlline.jar"/>
    </runtime>
    <requires>
    <import plugin="org.eclipse.ui"/>
    <import plugin="org.eclipse.core.resources"/>
    <import plugin="org.eclipse.jdt.core"/>
    <import plugin="org.eclipse.jdt.launching"/>
    </requires>
    <extension point="org.eclipse.ui.actionSets">
    <actionSet id="kodo.jdbc.integration.eclipse.actionSet"
    label="%action-set-name"
    visible="true">
    <menu id="kodo.menu"
    label="%group-label">
    <separator name="baseGroup"/>
    </menu>
    <action id="kodo.removeBuilder"
    label="%remove-builder-label"
    class="kodo.jdbc.integration.eclipse.RemoveBuilderAction"
    tooltip="%remove-builder-tooltip"
    menubarPath="kodo.menu/baseGroup"
    enablesFor="1">
    </action>
    <action id="kodo.addbuilder"
    label="%add-builder-label"
    class="kodo.jdbc.integration.eclipse.AddBuilderAction"
    tooltip="%add-builder-tooltip"
    menubarPath="kodo.menu/baseGroup"
    enablesFor="1">
    </action>
    <action id="kodo.mapping.build"
    label="%mapping-build-label"
    tooltip="%mapping-build-tooltip"
    class="kodo.jdbc.integration.eclipse.MappingToolAction$BuildSchema"
    icon="icons/BuildSchemaMappingTool.gif"
    menubarPath="kodo.menu/baseGroup"
    toolbarPath="Normal/Kodo"
    enablesFor="+">
    <selection class="org.eclipse.core.resources.IFile"
    name="*.jdo">
    </selection>
    </action>
    <action id="kodo.mapping.drop"
    label="%mapping-drop-label"
    tooltip="%mapping-drop-tooltip"
    class="kodo.jdbc.integration.eclipse.MappingToolAction$Drop"
    icon="icons/DropMappingTool.gif"
    menubarPath="kodo.menu/baseGroup"
    toolbarPath="Normal/Kodo"
    enablesFor="+">
    <selection class="org.eclipse.core.resources.IFile"
    name="*.jdo">
    </selection>
    </action>
    <action id="kodo.mapping.refresh"
    label="%mapping-refresh-label"
    tooltip="%mapping-refresh-tooltip"
    class="kodo.jdbc.integration.eclipse.MappingToolAction$Refresh"
    icon="icons/RefreshMappingTool.gif"
    menubarPath="kodo.menu/baseGroup"
    toolbarPath="Normal/Kodo"
    enablesFor="+">
    <selection class="org.eclipse.core.resources.IFile"
    name="*.jdo">
    </selection>
    </action>
    <action id="kodo.enhance"
    label="%enhance-label"
    icon="icons/EnhancerAction.gif"
    class="kodo.jdbc.integration.eclipse.EnhancerAction"
    tooltip="%enhance-tooltip"
    menubarPath="kodo.menu/baseGroup"
    toolbarPath="Normal/Kodo"
    enablesFor="+">
    <selection class="org.eclipse.core.resources.IFile"
    name="*.jdo">
    </selection>
    </action>
    </actionSet>
    </extension>
    <!-- lock our actions into the base perspective -->
    <extension point="org.eclipse.ui.perspectiveExtensions">
    <perspectiveExtension
    targetID="org.eclipse.ui.resourcePerspective">
    <actionSet
    id="kodo.jdbc.integration.eclipse.actionSet">
    </actionSet>
    </perspectiveExtension>
    </extension>
    <!-- put our extensions in -->
    <extension point="org.eclipse.ui.preferencePages">
    <page name="%preference-name"
    class="kodo.jdbc.integration.eclipse.KodoPreferencePage"
    id="kodo.jdbc.integration.eclipse.preferences.KodoPreferencePage">
    </page>
    </extension>
    <!-- lock in our eclipse-generated xml editor -->
    <extension point="org.eclipse.ui.editors">
    <editor name="%mappingeditor-name" extensions="mapping"
    icon="icons/mapping.gif"
    contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
    class="kodo.jdbc.integration.eclipse.editor.XMLEditor"
    id="kodo.jdbc.integration.eclipse.editor.XMLEditorMapping">
    </editor>
    <editor name="%editor-name" extensions="jdo,schema"
    icon="icons/metadata.gif"
    contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
    class="kodo.jdbc.integration.eclipse.editor.XMLEditor"
    id="kodo.jdbc.integration.eclipse.editor.XMLEditor">
    </editor>
    </extension>
    <!-- lock in our "view" -->
    <extension point="org.eclipse.ui.views">
    <view id="kodo.jdbc.integration.eclipse.KodoView"
    name="%view-name"
    category="org.eclipse.jdt.ui.java"
    icon="icons/kodosmall.gif"
    class="kodo.jdbc.integration.eclipse.KodoView">
    </view>
    </extension>
    <!-- lock in our builder -->
    <extension point="org.eclipse.core.resources.builders"
    id="kodo.jdbc.integration.eclipse.EnhancerBuilder"
    name="%builder-name">
    <builder>
    <run
    class="kodo.jdbc.integration.eclipse.EnhancerBuilder">
    </run>
    </builder>
    </extension>
    <!-- put our view onto the bottom bar -->
    <extension point="org.eclipse.ui.perspectiveExtensions">
    <perspectiveExtension
    targetID="org.eclipse.debug.ui.DebugPerspective">
    <view id="kodo.jdbc.integration.eclipse.KodoView"
    relative="org.eclipse.debug.ui.ExpressionView"
    relationship="stack"/>
    <viewShortcut id="org.eclipse.jdt.debug.ui.DisplayView"/>
    </perspectiveExtension>
    </extension>
    </plugin>

    I am not using Eclipse but am also experiencing problems similar to those
    described below. The fact is I cannot validate a configuration file which
    specifies either a traditional MySQL driver or a MySQL DataSoure.
    I am using what I believe to be the official stable version of MySQL
    Connector/J which is 3.0.11 and has been for several months. Are you
    saying that 3.0.11 (or even 3.0.8) is not supported?
    3.0.12 was recently released as the latest stable version so 3.0.11 should
    at least be supported by now.
    -Neil
    Stephen Kim wrote:
    The milestones are not fully supported versions as they are of beta
    quality. I would suggest using a proper release instead.
    Wolfgang Kundrus wrote:
    Hi,
    I have excactly the same behaviour here with Eclipse 3.0M8 and MySQL. It
    is the same with 3.0.8. and 3.0.11. What is the solution ?
    Best regards
    Wolfgang Kundrus
    Marc Prud'hommeaux wrote:
    Matthew-
    Everything looks correct to me. If you try an older version of the MySQL
    driver (such as 3.0.8, which is what we test with), do you see anything
    different?
    If you try to run a stand-alone Kodo program using the MySQL driver, do
    you see the same exception? If so, can you post the complete stack
    trace?
    In article <[email protected]>, Matthew T. Adams wrote:
    Hi,
    I'm getting the following error when trying to use the mapping tool from
    within eclipse 3.0M8:
    <error>-An error occurred running MappingTool
    kodo.util.FatalDataStoreException: No suitable driver
    NestedThrowables:
    java.sql.SQLException: No suitable driver
    <info>-Done.
    I followed the instructions on using the eclipse plugin, including copying
    all jars from kodo's lib folder to the plugin folder, copying the MySQL
    Connector/J jar to the kodo plugin folder, adding all of those jars to the
    project classpath, and even added an entry to the plugin.xml file to
    include the MySQL Connector/J jar. If I remove the project reference to
    the MySQL Connector/J jar, the error changes to:
    <error>-An error occurred running MappingTool
    kodo.util.FatalDataStoreException: com.mysql.jdbc.Driver
    NestedThrowables:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    <info>-Done.
    This would imply that adding a <library> entry for the MySQL Connector/J
    jar in my plugin.xml does not have any effect; if I remove it, I see the
    same error as above. If I add the MySQL jar back to the project
    classpath, the error changes back to 'No suitable driver' as above.
    The behavior is the same whether I use the Kodo preferences
    (WindowPreferencesKodo Preferences) individually without a
    kodo.properties file, or when I clear all individual properties and
    indicate a kodo.properties file.
    Help?
    Thanks,
    Matthew
    Here's my kodo.properties file:
    # Kodo JDO Properties configuration
    kodo.LicenseKey: xxx
    javax.jdo.PersistenceManagerFactoryClass:
    kodo.jdbc.runtime.JDBCPersistenceManagerFactory
    javax.jdo.option.ConnectionDriverName: com.mysql.jdbc.Driver
    javax.jdo.option.ConnectionUserName: root
    javax.jdo.option.ConnectionPassword:
    javax.jdo.option.ConnectionURL: jdbc:mysql://localhost/kodo
    javax.jdo.option.Optimistic: true
    javax.jdo.option.RetainValues: true
    javax.jdo.option.NontransactionalRead: true
    kodo.Log: DefaultLevel=WARN, Runtime=INFO, Tool=INFO
    Here's my eclipse-3.0M8/plugins/kodo.eclipse_2.1.0/plugin.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <plugin id="kodo"
    name="%name"
    version="1.0.1"
    provider-name="%provider-name"
    class="kodo.jdbc.integration.eclipse.KodoPlugin">
    <runtime>
    <!--
    Put your jdbc driver in this directory and enter the filename
    here (and configure in Preferences the changes you make) -->
    <!--<library name="jdbc-hsql-1_7_0.jar"/>-->
    <library name="mysql-connector-java-3.0.11-stable-bin.jar"/>
    <!-- ########### do not modify below ######### -->
    <!-- ########### do not modify below ######### -->
    <!-- ########### do not modify below ######### -->
    <!-- ########### do not modify below ######### -->
    <!-- ########### do not modify below ######### -->
    <library name="kodo-jdo.jar"/>
    <library name="jakarta-commons-collections-2.1.jar"/>
    <library name="jakarta-commons-lang-1.0.1.jar"/>
    <library name="jakarta-commons-pool-1.0.1.jar"/>
    <library name="jakarta-regexp-1.1.jar"/>
    <library name="jca1.0.jar"/>
    <library name="jdbc2_0-stdext.jar"/>
    <library name="jdo-1.0.1.jar"/>
    <library name="jta-spec1_0_1.jar"/>
    <library name="xalan.jar"/>
    <library name="xercesImpl.jar"/>
    <library name="xml-apis.jar"/>
    <library name="jfreechart-0.9.16.jar"/>
    <library name="jcommon-0.9.1.jar"/>
    <library name="mx4j-admb.jar"/>
    <library name="mx4j-jmx.jar"/>
    <library name="mx4j-tools.jar"/>
    <library name="jline.jar"/>
    <library name="sqlline.jar"/>
    </runtime>
    <requires>
    <import plugin="org.eclipse.ui"/>
    <import plugin="org.eclipse.core.resources"/>
    <import plugin="org.eclipse.jdt.core"/>
    <import plugin="org.eclipse.jdt.launching"/>
    </requires>
    <extension point="org.eclipse.ui.actionSets">
    <actionSet id="kodo.jdbc.integration.eclipse.actionSet"
    label="%action-set-name"
    visible="true">
    <menu id="kodo.menu"
    label="%group-label">
    <separator name="baseGroup"/>
    </menu>
    <action id="kodo.removeBuilder"
    label="%remove-builder-label"
    class="kodo.jdbc.integration.eclipse.RemoveBuilderAction"
    tooltip="%remove-builder-tooltip"
    menubarPath="kodo.menu/baseGroup"
    enablesFor="1">
    </action>
    <action id="kodo.addbuilder"
    label="%add-builder-label"
    class="kodo.jdbc.integration.eclipse.AddBuilderAction"
    tooltip="%add-builder-tooltip"
    menubarPath="kodo.menu/baseGroup"
    enablesFor="1">
    </action>
    <action id="kodo.mapping.build"
    label="%mapping-build-label"
    tooltip="%mapping-build-tooltip"
    class="kodo.jdbc.integration.eclipse.MappingToolAction$BuildSchema"
    icon="icons/BuildSchemaMappingTool.gif"
    menubarPath="kodo.menu/baseGroup"
    toolbarPath="Normal/Kodo"
    enablesFor="+">
    <selection class="org.eclipse.core.resources.IFile"
    name="*.jdo">
    </selection>
    </action>
    <action id="kodo.mapping.drop"
    label="%mapping-drop-label"
    tooltip="%mapping-drop-tooltip"
    class="kodo.jdbc.integration.eclipse.MappingToolAction$Drop"
    icon="icons/DropMappingTool.gif"
    menubarPath="kodo.menu/baseGroup"
    toolbarPath="Normal/Kodo"
    enablesFor="+">
    <selection class="org.eclipse.core.resources.IFile"
    name="*.jdo">
    </selection>
    </action>
    <action id="kodo.mapping.refresh"
    label="%mapping-refresh-label"
    tooltip="%mapping-refresh-tooltip"
    class="kodo.jdbc.integration.eclipse.MappingToolAction$Refresh"
    icon="icons/RefreshMappingTool.gif"
    menubarPath="kodo.menu/baseGroup"
    toolbarPath="Normal/Kodo"
    enablesFor="+">
    <selection class="org.eclipse.core.resources.IFile"
    name="*.jdo">
    </selection>
    </action>
    <action id="kodo.enhance"
    label="%enhance-label"
    icon="icons/EnhancerAction.gif"
    class="kodo.jdbc.integration.eclipse.EnhancerAction"
    tooltip="%enhance-tooltip"
    menubarPath="kodo.menu/baseGroup"
    toolbarPath="Normal/Kodo"
    enablesFor="+">
    <selection class="org.eclipse.core.resources.IFile"
    name="*.jdo">
    </selection>
    </action>
    </actionSet>
    </extension>
    <!-- lock our actions into the base perspective -->
    <extension point="org.eclipse.ui.perspectiveExtensions">
    <perspectiveExtension
    targetID="org.eclipse.ui.resourcePerspective">
    <actionSet
    id="kodo.jdbc.integration.eclipse.actionSet">
    </actionSet>
    </perspectiveExtension>
    </extension>
    <!-- put our extensions in -->
    <extension point="org.eclipse.ui.preferencePages">
    <page name="%preference-name"
    class="kodo.jdbc.integration.eclipse.KodoPreferencePage"
    id="kodo.jdbc.integration.eclipse.preferences.KodoPreferencePage">
    </page>
    </extension>
    <!-- lock in our eclipse-generated xml editor -->
    <extension point="org.eclipse.ui.editors">
    <editor name="%mappingeditor-name" extensions="mapping"
    icon="icons/mapping.gif"
    contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
    >>
    class="kodo.jdbc.integration.eclipse.editor.XMLEditor"
    id="kodo.jdbc.integration.eclipse.editor.XMLEditorMapping">
    </editor>
    <editor name="%editor-name" extensions="jdo,schema"
    icon="icons/metadata.gif"
    contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
    >>
    class="kodo.jdbc.integration.eclipse.editor.XMLEditor"
    id="kodo.jdbc.integration.eclipse.editor.XMLEditor">
    </editor>
    </extension>
    <!-- lock in our "view" -->
    <extension point="org.eclipse.ui.views">
    <view id="kodo.jdbc.integration.eclipse.KodoView"
    name="%view-name"
    category="org.eclipse.jdt.ui.java"
    icon="icons/kodosmall.gif"
    class="kodo.jdbc.integration.eclipse.KodoView">
    </view>
    </extension>
    <!-- lock in our builder -->
    <extension point="org.eclipse.core.resources.builders"
    id="kodo.jdbc.integration.eclipse.EnhancerBuilder"
    name="%builder-name">
    <builder>
    <run
    class="kodo.jdbc.integration.eclipse.EnhancerBuilder">
    </run>
    </builder>
    </extension>
    <!-- put our view onto the bottom bar -->
    <extension point="org.eclipse.ui.perspectiveExtensions">
    <perspectiveExtension
    targetID="org.eclipse.debug.ui.DebugPerspective">
    <view id="kodo.jdbc.integration.eclipse.KodoView"
    relative="org.eclipse.debug.ui.ExpressionView"
    relationship="stack"/>
    <viewShortcut id="org.eclipse.jdt.debug.ui.DisplayView"/>
    </perspectiveExtension>
    </extension>
    </plugin>
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Need help with mysql-connector-j setup!

    I have downloaded and installed Tomcat 5.5 and MySQL Server 5.0 and have both up and running. I then downloaded the MySQL-Connector-J and the folder is located at:
    C:\Program Files\Java\jre1.5.0_06\lib\ext\mysql-connector-java-3.1.12
    My JSP code looks like this:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ page import="java.net.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.sql.*" %>
    <%
         try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         catch (Exception E) {
         out.println("Unable to load driver. " + E);
    %>And I am getting the folowing error:
    java.lang.ClassNotFoundException: com.mysql.jdbc.DriverNow, before anyone tells me to go read other posts, I have already done this and I have tried changing my classpath with no luck. I have tried these locations as my classpath:
    C:\Program Files\Java\jre1.5.0_06\lib\ext\mysql-connector-java-3.1.12
    C:\Program Files\Java\jre1.5.0_06\lib\ext\mysql-connector-java-3.1.12\mysql-connector-java-3.1.12-bin.jar
    Neither of which seem to work. Can anyone figure out what's happening here?

    Ok, I copied it to the <tomcat dir>/common/lib, but I copied the entire folder (which I'm assuming is necessary), with no luck. So, now the location is:
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\mysql-connector-java-3.1.12\mysql-connector-java-3.1.12-bin.jar
    Any other suggestions?
    Thanks.
    null

  • Java\jdk1.6.0_02\jre\lib\ext\mysql-connector-java-5.1.16-bin.jar was unexp

    Hello, please i am new to Jdeveloper and weblogic servers and i developed an application using jdeveloper and when i try to run the application it brings up this error message
    "*** Using HTTP port 7101 ***
    *** Using SSL port 7102 ***
    C:\Users\Lucky\AppData\Roaming\JDeveloper\system11.1.2.3.39.62.76.1\DefaultDomain\bin\startWebLogic.cmd
    [waiting for the server to complete its initialization...]
    \Java\jdk1.6.0_02\jre\lib\ext\mysql-connector-java-5.1.16-bin.jar was unexpected at this time.
    Process exited."
    I tried deleting the jdk1.6.6.0_02 and tried it again but it still did not run, I also uninstalled the JDeveloper and weblogic server and reinstalled them but the error message still pops up. Please i need help to fix this.
    Thanks.
    Edited by: Chinedu on Feb 21, 2013 8:48 AM

    Andrew,
    Thanks for the lightning response... but the problem has been solved.
    I rebooted again, and installed again (didn't download again because the filesize checked out) and now it works fine, and I'm none the wiser as to the root cause of the problem, except that rt.jar has magically appeared:
    C:\Users\Administrator>dir "C:\Program Files\Java\jre6\lib\*.jar"
    Volume in drive C has no label.
    Volume Serial Number is 00AC-1BC7
    Directory of C:\Program Files\Java\jre6\lib
    08/11/2009  06:38 PM         6,685,813 charsets.jar
    08/11/2009  06:38 PM         2,989,538 deploy.jar
    08/11/2009  06:38 PM           716,841 javaws.jar
    08/11/2009  06:38 PM            88,256 jce.jar
    08/11/2009  06:38 PM           558,189 jsse.jar
    08/11/2009  06:38 PM               382 management-agent.jar
    08/11/2009  06:38 PM         1,704,664 plugin.jar
    08/11/2009  06:38 PM         1,115,985 resources.jar
    08/11/2009  06:38 PM        44,295,255 rt.jar                             <<<<<<<<<<<<<<<<<<
                   9 File(s)     58,154,923 bytes
                   0 Dir(s)  115,454,173,184 bytes freeSOOOO... I presume that the installer failed on rt.jar, probably because something (something in my start-up, I suppose) was using the JRE while the instal was running... but I didn't do anything different the second time (to the best of my knowledge).
    Thanks anyways... My hair (what's left of it) greatly appreciates your time.
    Cheers. Keith.

  • Need Help Connect to MySQL using dg4odbc

    I am looking for some help getting a dblink working from my Oracle 11.1.0.6 Dtabase to a MySQL 5.0.77 Database (Holds Bugzilla).
    This is the error I get when I try select * from "bugs"@bugz;
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [MySQL][ODBC 5.1 Driver][mysqld-5.0.77]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"bug_id" FROM "bugs" A1' at line 1
    ORA-02063: preceding 2 lines from BUGZ
    On Server hosting Oracle DB:
    lsb_release -id
    Distributor ID: RedHatEnterpriseServer
    Description: Red Hat Enterprise Linux Server release 5.7 (Tikanga)
    rpm -qa|grep mysql
    mysql-connector-odbc-5.1.8-1.rhel5
    mysql-5.0.77-4.el5_6.6
    tnsping BUGZ
    TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 08-DEC-2011 07:53:52
    Copyright (c) 1997, 2007, Oracle. All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))) (CONNECT_DATA = (SID = BUGZ)) (HS = OK))
    OK (0 msec)
    tnsnames.ora
    BUGZ =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SID = BUGZ)
        (HS = OK)
      )listener.ora
    SID_LIST_LISTENER =
      (SID_LIST =
         (SID_DESC =
            (ORACLE_HOME = /u00/app/oracle/product/11.1.0/db_1)
            (SID_NAME = BUGZ)
            (PROGRAM = dg4odbc)
            (ENVS ="LD_LIBRARY_PATH=/u00/app/oracle/product/11.1.0/db_1/lib:/usr/lib64:/usr/lib")
    .../u00/app/oracle/product/11.1.0/db_1/hs/admin/initbugz.ora
    # This is a sample agent init file that contains the HS parameters that are
    # needed for the Database Gateway for ODBC
    # HS init parameters
    HS_FDS_CONNECT_INFO=bugz
    HS_FDS_TRACE_LEVEL=off
    HS_FDS_SHAREABLE_NAME=/usr/lib64/libmyodbc5.so
    HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P15
    # ODBC specific environment variables
    set ODBCINI=/u00/home/oracle/.odbc.ini
    # Environment variables required for the non-Oracle system
    set HOME=/u00/home/oracle
    ~/u00/home/oracle/.odbc.ini
    [ODBC Data Sources]
    [bugz]
    Driver      = /usr/lib64/libmyodbc5.so
    DATABASE    = bugzilla
    DESCRIPTION = MySQL ODBC 5.x Connector
    PORT        = 3306
    SERVER      = bugzilla
    UID         = bugquery
    PWD         = password
    CHARSET     = latin1
    TRACEFILE   = /tmp/myodbc-bugzdsn.trc
    TRACE       = OFFODBC Test
    isql -v bugz
    +---------------------------------------+
    | Connected!                            |
    |                                       |
    | sql-statement                         |
    | help [tablename]                      |
    | quit                                  |
    |                                       |
    +---------------------------------------+
    SQL> help bugs
    [Bunch of stuff omitted]
    SQLRowCount returns 31
    31 rows fetched
    SQL>

    I did the delete and reconnected and the rows where created again.
    I am testing with two SQL statements right now from TOAD and from SQLPlus.
    A. select bugs."bug_id" as Ticket, bugs."short_desc", bugs."bug_status" AS Status, bugs."assigned_to", dump(bugs."short_desc") from "bugs"@BUGZ bugs where "bug_id" = 2;
    B. select bugs."bug_id" as Ticket, bugs."short_desc", bugs."bug_status" AS Status, bugs."assigned_to" from "bugs"@BUGZ bugs
    When I issue "A" I get good looking results. When I issue "B" I get an error.
    SQL> select bugs."bug_id" as Ticket, bugs."short_desc", bugs."bug_status" AS Status, bugs."assigned_to", dump(bugs."short_desc") from "bugs"@BUGZ bugs where "bug_id" = 2;
        TICKET
    short_desc
    STATUS                                                           assigned_to
    DUMP(BUGS."SHORT_DESC")
             2
    COMA computer has updates set to auto install  please disable and allow me to ch
    oose
    CLOSED                                                                     8
    Typ=1 Len=168: 0,67,0,79,0,77,0,65,0,32,0,99,0,111,0,109,0,112,0,117,0,116,0,101
        TICKET
    short_desc
    STATUS                                                           assigned_to
    DUMP(BUGS."SHORT_DESC")
    ,0,114,0,32,0,104,0,97,0,115,0,32,0,117,0,112,0,100,0,97,0,116,0,101,0,115,0,32,
    0,115,0,101,0,116,0,32,0,116,0,111,0,32,0,97,0,117,0,116,0,111,0,32,0,105,0,110,
    0,115,0,116,0,97,0,108,0,108,0,32,0,32,0,112,0,108,0,101,0,97,0,115,0,101,0,32,0
    ,100,0,105,0,115,0,97,0,98,0,108,0,101,0,32,0,97,0,110,0,100,0,32,0,97,0,108,0,1
    08,0,111,0,119,0,32,0,109,0,101,0,32,0,116,0,111,0,32,0,99,0,104,0,111,0,111,0,1
        TICKET
    short_desc
    STATUS                                                           assigned_to
    DUMP(BUGS."SHORT_DESC")
    15,0,101
    SQL> select bugs."bug_id" as Ticket, bugs."short_desc", bugs."bug_status" AS Status, bugs."assigned_to" from "bugs"@BUGZ bugs;
    ERROR:
    ORA-28528: Heterogeneous Services datatype conversion error
    ORA-02063: preceding line from BUGZ
    no rows selectedThe bugs table looks like this:
    CREATE TABLE `bugs` (
      `bug_id` mediumint(9) NOT NULL auto_increment,
      `assigned_to` mediumint(9) NOT NULL,
      `bug_file_loc` mediumtext,
      `bug_severity` varchar(64) NOT NULL,
      `bug_status` varchar(64) NOT NULL,
      `creation_ts` datetime default NULL,
      `delta_ts` datetime NOT NULL,
      `short_desc` varchar(255) NOT NULL,
      `op_sys` varchar(64) NOT NULL,
      `priority` varchar(64) NOT NULL,
      `product_id` smallint(6) NOT NULL,
      `rep_platform` varchar(64) NOT NULL,
      `reporter` mediumint(9) NOT NULL,
      `version` varchar(64) NOT NULL,
      `component_id` smallint(6) NOT NULL,
      `resolution` varchar(64) NOT NULL default '',
      `target_milestone` varchar(20) NOT NULL default '---',
      `qa_contact` mediumint(9) default NULL,
      `status_whiteboard` mediumtext NOT NULL,
      `votes` mediumint(9) NOT NULL default '0',
      `lastdiffed` datetime default NULL,
      `everconfirmed` tinyint(4) NOT NULL,
      `reporter_accessible` tinyint(4) NOT NULL default '1',
      `cclist_accessible` tinyint(4) NOT NULL default '1',
      `estimated_time` decimal(7,2) NOT NULL default '0.00',
      `remaining_time` decimal(7,2) NOT NULL default '0.00',
      `deadline` datetime default NULL,
      `alias` varchar(20) default NULL,
      `cf_type` varchar(64) NOT NULL default '---',
      `cf_notes` mediumtext,
      `keywords` mediumtext NOT NULL,
      PRIMARY KEY  (`bug_id`),
      UNIQUE KEY `bugs_alias_idx` (`alias`),
      KEY `bugs_assigned_to_idx` (`assigned_to`),
      KEY `bugs_creation_ts_idx` (`creation_ts`),
      KEY `bugs_delta_ts_idx` (`delta_ts`),
      KEY `bugs_bug_severity_idx` (`bug_severity`),
      KEY `bugs_bug_status_idx` (`bug_status`),
      KEY `bugs_op_sys_idx` (`op_sys`),
      KEY `bugs_priority_idx` (`priority`),
      KEY `bugs_product_id_idx` (`product_id`),
      KEY `bugs_reporter_idx` (`reporter`),
      KEY `bugs_version_idx` (`version`),
      KEY `bugs_component_id_idx` (`component_id`),
      KEY `bugs_resolution_idx` (`resolution`),
      KEY `bugs_target_milestone_idx` (`target_milestone`),
      KEY `bugs_qa_contact_idx` (`qa_contact`),
      KEY `bugs_votes_idx` (`votes`),
      CONSTRAINT `fk_bugs_assigned_to_profiles_userid` FOREIGN KEY (`assigned_to`) REFERENCES `profiles` (`userid`) ON UPDATE CASCADE,
      CONSTRAINT `fk_bugs_component_id_components_id` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`) ON UPDATE CASCADE,
      CONSTRAINT `fk_bugs_product_id_products_id` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON UPDATE CASCADE,
      CONSTRAINT `fk_bugs_qa_contact_profiles_userid` FOREIGN KEY (`qa_contact`) REFERENCES `profiles` (`userid`) ON UPDATE CASCADE,
      CONSTRAINT `fk_bugs_reporter_profiles_userid` FOREIGN KEY (`reporter`) REFERENCES `profiles` (`userid`) ON UPDATE CASCADE
    ) ENGINE=InnoDB AUTO_INCREMENT=4570 DEFAULT CHARSET=utf8;Edited by: Sky13 on Dec 22, 2011 1:36 PM

  • JSTL - MySQL Connector problem

    Hello! I need your help. I don't actually know the reason, but *<sql:query>* doesn't work properly.
    So I have such a code:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql_rt" %>
    <sql:setDataSource var="datasource"
    driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/publish"
    user="root" password="root"/>
    <sql:query var="books" dataSource="${datasource}">
    SELECT id, title, price FROM book
    </sql:query>
    <html>
    <head>
    <title>A First JSP Database</title
    </head>
    <body>
    <table border="1">
    <tr>
    <td>id</td><td>title</td><td>price</td>
    </tr>
    <c:forEach items="${books.rows}" var="row">
    <tr>
    <td><c:out value="${row.id}" /></td>
    <td><c:out value="${row.title}" /></td>
    <td><c:out value="${row.price}" /></td>
    </tr>
    </c:forEach>
    </table>
    </body>
    </html>The error I get when calling http://localhost:8080/DataAccess/bookList.jsp
    org.apache.jasper.JasperException: Exception in JSP: /bookList.jsp:7
    4:                  driver="com.mysql.jdbc.Driver"
    5:                     url="jdbc:mysql://localhost:3306/publish"
    6:                    user="root" password="root"/>
    7: <sql:query var="books" dataSource="${datasource}">
    8:   SELECT id, title, price FROM book
    9: </sql:query>
    10: <html>May be the reason is that the subfolder WEB-INF is badly configured.
    I have such subfolders in WEB-INF:
    */lib*
    jaxen-full.jar
    jdbc2_0-stdext.jar
    jstl.jar
    mysql-connector-java-3.0.9-stable-bin.jar
    saxpath.jar
    standard.jar
    xalan.jar
    xercesImpl.jar
    xml-apis.jar
    */tld*
    c-rt.tld
    c.tld
    fmt-rt.tld
    fmt.tld
    sql-rt.tld
    sql.tld
    x-rt.tld
    x.tldThe question is what is configured or done incorrectly? I am not quite familiar with JSP and JSTL. Thank you for any help.
    P.S I have already used MySQL. So it is set and configured as it is needed to be.

    ThomYork
    It didn't help.
    Just in case, I run tomcat 5.5.27-2 on Arch Linux; MySQL 5.0.77; Apache 2.2.11
    I tried to put mysql-connector-java-3.0.9-stable-bin.jar into
    /opt/tomcat/server/lib
    /opt/tomcat/shared/lib
    It didn't help.
    bandarurm
    After some manipulation i get such an error in my script:
    *exception*
    {noformat}org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: "Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused"
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    {noformat}
    *root cause*
    {noformat}javax.servlet.ServletException: Unable to get connection, DataSource invalid: "Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused"
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp.bookList_jsp._jspService(bookList_jsp.java:89)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    {noformat}
    *root cause*
    {noformat}javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused"
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276)
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159)
         org.apache.jsp.bookList_jsp._jspx_meth_sql_005fquery_005f0(bookList_jsp.java:130)
         org.apache.jsp.bookList_jsp._jspService(bookList_jsp.java:66)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    {noformat}
    dsdsf
    I tried this. I downloaded the example with the source and WEB-INF directory. It doesn't work.
    Here is an error:
    *exception*
    {noformat}org.apache.jasper.JasperException: javax.servlet.jsp.JspTagException: In <driver>, invalid driver class name: "java.lang.ClassNotFoundException: com.mysql.jdbc.Driver"
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    {noformat}
    *root cause*
    {noformat}javax.servlet.ServletException: javax.servlet.jsp.JspTagException: In <driver>, invalid driver class name: "java.lang.ClassNotFoundException: com.mysql.jdbc.Driver"
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:837)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp.executeQuery_005fJstlSqlTag_jsp._jspService(executeQuery_005fJstlSqlTag_jsp.java:116)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    {noformat}
    *root cause*
    {noformat}java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
         java.lang.Class.forName0(Native Method)
         java.lang.Class.forName(Class.java:264)
         org.apache.taglibs.standard.tag.common.sql.DataSourceWrapper.setDriverClassName(DataSourceWrapper.java:46)
         org.apache.taglibs.standard.tag.common.sql.SetDataSourceTagSupport.doStartTag(SetDataSourceTagSupport.java:102)
         org.apache.taglibs.standard.tag.el.sql.SetDataSourceTag.doStartTag(SetDataSourceTag.java:67)
         org.apache.jsp.executeQuery_005fJstlSqlTag_jsp._jspx_meth_sql_005fsetDataSource_005f0(executeQuery_005fJstlSqlTag_jsp.java:137)
         org.apache.jsp.executeQuery_005fJstlSqlTag_jsp._jspService(executeQuery_005fJstlSqlTag_jsp.java:88)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    {noformat}Nothing with sql query works. So it seems that the problem is in tomcat's configuration.

  • JDBC MySQL connector & autoexec.bat

    This what I entered into my autoexec file but when I run my java program it gives me a 'no suitable driver' error. I do not know what I should be entering for the
    'CLASSPATH' in the autoexec. Below is what I entered. The file jar file is located in my C:\unzipped\mysql-connector-java-3.1.7/ folder.
    C:\unzipped\mysql-connector-java-3.1.7\mysql-connector-java-3.1.7-bin.jar%CLASSPATH%
    Can somebody with knowledge in installing the JDBC driver for MySQL give me some help please.

    This works perfectly in the Eclipse IDE area that I have but when I run the same program on the Net Beans 3.6 IDE area it gives me a 'not suitable driver' error. To note these are both on the same computer. I would really like to get the Net Beans 3.6 IDE working because that is what I am most familiar with using. If you know of the problem why one IDE area recognizes the driver where the next does not I would sure like to know. Somebody passed the idea that when the 3.6 area is executed there are multiple instances running and it resets the ClassPath(I think they where shooting in the dark but it is a lead none the less). Anyway if anybody has had this problem please enlighten me, Thank-You.
    The ClassPath is set to the following:
    ClassPath = C:\Program Files\Java\jdk1.5.0_02\lib;C:\unzipped\mysql-connector- java-3.1.7\mysql-connector-java-3.1.7;C:\Program Files
    \Java\jdk1.5.0_02\jre\lib\ext;
    This is the code:
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class Connect2 {
         public static void main(String[] args) {
              try {
                   // The newInstance() call is a work around for some
                   // broken Java implementations
                   Class.forName("com.mysql.jdbc.Driver");
              } catch (Exception ex) {
                   System.out.println("HERE");
              try {
                   String url = "jdbc:mysql://localhost/test";
                   String username = "root";
                   String password = "password";
                   Connection conn = DriverManager.getConnection(
                             "jdbc:mysql://localhost/test", "root", "password");
                   Statement c = conn.createStatement();
                   c.execute("insert into green values('richmond')");
                   c.execute("select * from green");
                   ResultSet rs = c.getResultSet();
                   while (rs.next()) {
                        System.out.println(rs.getString(1));
                   // Do something with the Connection
              } catch (SQLException ex) {
                   // handle any errors
                   System.out.println("SQLException: " + ex.getMessage());
                   System.out.println("SQLState: " + ex.getSQLState());
                   System.out.println("VendorError: " + ex.getErrorCode());
    }

  • Mysql connector

    hello everyone!
    i'm doing a project that is a web based email system..
    My pc is running under windows xp pro and i've installed and configured j2sdk1.4.1, Apache Tomcat 4.1.12LE and mysql 31.23.51.The problem i need to connect to the db.. so i've downloaded mysql-connector-java-2.0.14.How do i set the classpath in order to jsp to connect mysql...
    it would be helpful to show the steps... Thank you..

    you can put mysql-connector.jar on the common/lib folder of tomCat.
    FYI :
    driverClass : com.mysql.jdbc.Driver
    url : jdbc:mysql://hostname/databasename
    Regrds.

  • Java Mysql Connector

    Hi everyone,
    I started to work on JDBC but i have a few questions about the mysql connector.
    I downloaded the .zip file and unzipped it to my desktop. Now i have a .jar file , a few folders , a installation guide and a read me file. But i couldn't understand the exact installation.
    First of all where do i have to place this files? In which directory? I have a mysql database installed. But only the guide say is "calling the class.forname() function!"
    I have no idea , what to place inside the forname function and where to install the connector files!
    If u could tell me step by step i'll be really appreciate. Thanks for your helps.
    Waiting for your answers :)

    Let's see...
    C:\Java\AppServer\jdk\bin\javac.exe is "javac
    1.5.0_06"
    .... That's the complete Java EE 5 SDKNo, javac.exe is part of Java SE. You have to have it for Java EE, of course. This version should match that of java.exe. Why does it not?
    C:\Java\bin\java.exe is java version "1.5.0_08"How is it that the versions of javac.exe and java.exe don't match? You're making a mess here.
    c:\MySQL50\bin\mysqld.exe is Ver 5.0.22-community
    for Win32 on ia32 (MySQL Community Edition (GPL))Very good. Can you connect to MySQL using its client?
    I've got copies of mysql-connector-java-5.0.3-bin.jar
    all over the shop including:This is wrong. Don't have them "all over the shop".
    C:\Java\lib\mysql-connector-java-3.1.13Wrong. Remove it.
    C:\Program Files\Java\jre1.5.0_08\lib\ext //how the
    flock did that get there?Didn't you say that you put it there? Wrong. Remove it.
    C:\Program Files\Apache\Tomcat5.5\common\libCorrect. Leave it there.
    C:\Program Files\Apache\Tomcat5.5\shared\libWrong. Remove it.
    C:\Program
    Files\Apache\Tomcat5.5\webapps\krc\WEB-INF\libPossibly wrong. Remove it.
    You should have that JAR in one place from the point of view of your web context.
    My system settings look like thisMicrosoft
    Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\Documents and Settings\Keith>echo %PATH%
    C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbe
    m;C:\MSSQL\BINN;C:\MySQL50\bin;C:\Program
    Files\QuickTime\QTSystem\;C:\Program
    Files\Apache\ant-1.6.5\bin;C:\Program
    Files\GNU\cvsnt;C:\Program Files\Microsoft SQL
    Server\90\Tools\binn\;C:\java\bin;C:\java\apps
    rver\bin;C:\java\appserver\jdk\bin;c:\program
    files\devstudio\sharedide\bin\ide;c:\program
    files\devstudio\sharedide\bin;c:\program
    files\devstudio\visualc\bin;
    C:\Documents and Settings\Keith>echo %CLASSPATH%
    .;C:\Java\lib\;C:\Java\lib\ext\QTJava.zip;C:\Java\hsql
    db\lib;C:\Java\lib\jakarta-oro-2.0.8\jakarta-oro-2.0.8
    .jarTomcat ignores that CLASSPATH. It does you no good at all. I don't have a system CLASSPATH on any machine I use.
    C:\Documents and Settings\Keith>echo %CATALINA_HOME%
    C:\Program Files\Apache\Tomcat5.5Fine. Might be good to put in in quotes, because that space between Program and Files might be problematic. Save for all other paths with spaces in them.
    C:\Documents and Settings\Keith>echo %JAVA_HOME%
    C:\Java\AppServer\jdk
    Notice that Connector/J is not in my class
    path.Notice that Tomcat doesn't care.
    my code is the same as yours above except for
    formatting, better exception messages, and the
    username and password are different, which are case
    sensitive BTW.import java.sql.*;
    public class Connector {
         public static void main (String[] args) {
              Connection conn = null;
              try {
                   String userName = "keith";
                   String password = "**********";
                   String url = "jdbc:mysql://localhost/test";
    Class.forName
    ame ("com.mysql.jdbc.Driver").newInstance ();
    conn = DriverManager.getConnection (url, userName,
    me, password);
    System.out.println ("Database connection
    ion established");
              } catch (Exception e) {
                   System.err.println ("getConnection: " + e);
              } finally {
                   if (conn != null) {
                        try {
                             conn.close ();
    System.out.println ("Database connection
    ction terminated");
                        } catch (Exception e) {
                             /* ignore close errors */
    }hope this helps... Keith.
    corlettk: oh yeah.. and mysqld is installed as a
    service, which is running. tomcat isn't running, it's
    not required for this test.If you run this test on the command line, you'd better be using the -classpath option to tell the JVM where to find the MySQL connector JAR. The JVM ignores your system CLASSPATH, too.
    %

  • Using mysql-connector-java-5.0.5 from oracle's java procedure.

    I need to write the java procedure in Oracle, which will get connection to mySQL server and put some data into it. I am using official mysql-connector-java-5.0.5 driver for this job. Java class for this job work well outside the Oracle. The problem is:
    When I try to import jar file of mysql connectior it fail son resolving inside the Oracle db. How can I get access to mysql from Oracle?

    Thanks for this quick reply!!
    --When adding a connection and clicking 'Test' in the end of the wizard or when right-click on the connection and click 'connect'.
    Also, I've just noticed this: when I start IDE using jdev.exe I'm getting:
    java.lang.NullPointerException at oracle.jdevimpl.cm.dt.DatabaseAddin._registerIDEObjects(DatabaseAddin.java:353)
    at oracle.jdevimpl.cm.dt.DatabaseAddin.initialize(DatabaseAddin.java:155
    at oracle.ideimpl.extension.AddinManagerImpl.initializeAddin(AddinManage
    rImpl.java:425)
    at oracle.ideimpl.extension.AddinManagerImpl.initializeAddins(AddinManag
    erImpl.java:240)
    at oracle.ideimpl.extension.AddinManagerImpl.initProductAndUserAddins(Ad
    dinManagerImpl.java:154)
    at oracle.ide.IdeCore.initProductAndUserAddins(IdeCore.java:1431)
    at oracle.ide.IdeCore.startupImpl(IdeCore.java:1196)
    at oracle.ide.Ide.startup(Ide.java:674)
    at oracle.ideimpl.Main.start(Main.java:49)
    at oracle.ideimpl.Main.main(Main.java:25)
    Does not look right to me.
    I've never tried to add a DB connection under this IDE installation earlier.
    Just yeasterday I've created a project with some DB related (mySQL and Hibernate) libraries, although it compiled fine.

  • PreparedStatements and MySQL Connector/J

    Hi All,
    I was wondering what is the exact SQL statement that is passed to MySQL server when we use PreparedStatements. I was trying using MySQL Connector/J, type4 driver. I tried with a simple servlet
        public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException   {
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<body>");
            out.println("<head>");
              try {
                   Class.forName("com.mysql.jdbc.Driver");
                   Connection con=DriverManager.getConnection("jdbc:mysql://localhost/mydb?user=root","root","");
                   //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   //Connection con=DriverManager.getConnection("jdbc:odbc:test");
                   PreparedStatement pst=con.prepareStatement("select * from AS_ITM where ID_ITM=?");
                   out.println("PreparedStatement = "+pst);
                   out.println("<br>");
                   pst.setString(1, "10");
                   out.println("PreparedStatement = "+pst);
                   //ResultSet rs=pst.executeQuery();
                   con.close();
              }catch(Exception e){
                   out.println(e);
            out.println("</head>");
            out.println("<body>");
            out.println("</body>");
            out.println("</html>");
    Here I am printing PreparedStatement  object's generated SQL twice and not even executing the query.
    And the result is:
    PreparedStatement = com.mysql.jdbc.PreparedStatement@19f3736: select * from AS_ITM where ID_ITM=** NOT SPECIFIED **
    PreparedStatement = com.mysql.jdbc.PreparedStatement@19f3736: select * from AS_ITM where ID_ITM='10'
    See second statement? I have not even sent it to the server.
    So is this jdbc driver preparing a simple Statement before it is sent to MySQL server?
    Is it what a jdbc driver is supposed to do? So then whats the use of PreparedStatement?Thanks,
    Kishor

    Hi,
    Just exactly what a JDBC driver is supposed to do with a PreparedStatement is not specified in JDBC I believe. I think they only requirement is that a PreparedStatement should be able to insert the various data types correctly into an SQL string.
    I am fully aware that PreparedStatements should also be able to give a better performance, for instance by only sending the parameters when you use it the second time, and not the whole the SQL. But I think this is up to the database and driver implementation to decide whether to do this, and how.
    Remember, the JDBC driver may be sending other information across to the database than the SQL. We can't see that from looking at the PreparedStatement only. You would have to use a network packet sniffer to see all data exchanged between the driver and the database
    -Jakob Jenkov

  • Mysql connector & ssl

    Hi,
    I have enabled ssl on my mysql server and am using useSSL=true&requireSSL=true in my jdbc connector url.
    I am getting the following error:
    The root cause was that: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** com.mysql.jdbc.CommunicationsException MESSAGE: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** javax.net.ssl.SSLHandshakeException MESSAGE: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target STACKTRACE: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)  at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187) at
    If anyone had any success connecting to mysql via ssl I would appreciate any help.
    Thanks!

    I used the mysql odbc connector with the certificate and it worked fine so
    the problem is not the certificate.
    2009/4/8 Alexei Yakovenko <[email protected]>
    drieh,
    >
    A new message was posted in the thread "mysql connector &amp; ssl":
    >
    http://forums.adobe.com/message/1877560#1877560
    >
    Author  : Alexei Yakovenko
    Email   : [email protected]
    Profile : http://forums.adobe.com/people/injun%20%5B576871%5D
    >
    Message:

  • JDBC MySQL Connector/J problems when using in applets

    I wrote a piece of code which uses the MySQL Connector/J which worked in a normal shell application but when used in an applet it just didnt print anything. The code is:
    import java.net.*;
    import java.sql.*;
    class DB {
    static Connection c;
    static Statement stmt;
    static ResultSet to;
    public static String[] getUsers() {
         String str[] = new String[100];
         try {
              Class.forName("com.mysql.jdbc.Driver").newInstance();
         catch (Exception E) {}
         try {
              c = DriverManager.getConnection("jdbc:mysql://localhost/PROGRAM?user=blah&password=blah");
              stmt = c.createStatement();
              to = stmt.executeQuery("SELECT usr_user FROM usr");
              for(int i=0; to.next(); i++) str[i] = to.getString(1);
         catch (SQLException E) {}
         return str;
    Is there a problem accessing a MySQL Database via an applet

    Applet runs out of a sandbox, if you print the exception, you'll see that you have run into security access violation:
    catch (SQLException E) {
    E.printStackTrace();
    }This will tell you why your applet didn't print anything. Just a firendly advice, never try to catch something and don't display what was caught.
    ;o)
    V.V.
    PS: To solve, your problem, you can either sign the applet or use a policy file to grant the applet the required access right.

Maybe you are looking for

  • Report to fetch assigned transactions for multiple role.

    Hi, I am looking for some report or the way, i can get the list of transaction assigned to multiple roles in one go. Actually i tried SUIM, but here i have to specify one role at a time and have the list of transactions assigned to it. My scenario is

  • Problem to read an external file in a web application

    Hello everybody. I'd like to know a method for reading a file (how I may connect to it?) This file is in a directory is in an external computer. I don't want to use a client/server application. I think that I must to use JNDI but I'm not sure. I thin

  • Imessage can't register

    Just downloaded and installed OS X 10.8.2 Imessage doesn't connect... Keep getting "Could Not Connect" with error message "The server encountered an error processing registration. Please try again later." Anyone Else having this issue?

  • TCURR field TCURR_UKURS - field length is too short

    Has ECC6 addressed the field length issue of 9 characters (5 decimals) in table TCURR field UKURS to cater for weak currencies, to avoid using ratios of 1000:1

  • There is no iView available for system "SAP_SRM": object "Permission".

    Hi All, We have portal ( SAP 7.01 SP3 patch level 3) as the front end for SRM 7.0 ,We have integrated SRM with portal through the system alias SAP_SRM. When RFx Approver click on u201Cpermissionu201D button in u201CPurchasingu201D -> u201CSourcingu20