Include MySQL Connector in JAR

Is there a way to somehow include the MySQL connector in one of my JARs so that a user does not have to have two JARs in one folder for one program to run? Like, instead of having ThisJAR.jar AND MySQL_Connector.jar in one folder for ThisJAR to use MySQL_Connector for a database connection, I just want ThisJAR.jar.
I think I made that as confusing as it could possibly be. :-P
Thanks in advance,
Zach
Edited by: Zach on Apr 15, 2009 6:53 PM

>
Is there a way to somehow include the MySQL connector in one of my JARs so that a user does not have to have two JARs in one folder for one program to run? >If you want to make it simple for the end-user, and your app. has a GUI, deploy it using webstart.
A single link can take them to the 'download' page that uses [deployJava.js|http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html] to check a suitable minimum version of Java is available before inserting the link to the launch/install file. If the user 'follows the prompts' from there, they might end up with a single menu item to launch the app., and no visible Jars.
I provide some [examples of the webstart API|http://pscode.org/jws/api.html] that show some services available to apps. launched using webstart, of particular use for your project might be the ExtensionInstallerService to install the DB, and the PersistenceService to store the path the user chose to install it (you would offer them the choice, of course).
Java webstart also offers other nice features like splash screens, icons..
Again, check the licensing arrangements - you might show the MySql license when installing.

Similar Messages

  • Using MySQL connector from jar

    I want to use MySQLconnector without unziping it. that is, directly from the jar file.
    Anyone know how to do that??
    thanx

    MySQLconnector is the paquet with the necesary drivers to connect to a MySQL database server.
    Those drivers are classes packed in a jar file.
    To actually use the connector you have to load it with the following line:
    Class.forName("com.mysql.jdbc.Driver") ;
    That works fine if I unzip the jar file in the working directory. But if I just put the jar file alone, the line above throws an exception because it cannot be able to find the class.

  • "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

  • [solved] MySQL Connector C++ 1.0.5

    Hello everyone,
    I'm trying to connect to a MySQL db via C++. MySQL has the connector and API available for this. In the process of building this I've run into some troubles/questions.
    First off is that MySQL states that MySQL Workbench uses this connector:
    MySQL wrote:Note that MySQL Workbench is successfully using MySQL Connector/C++.
    source (at the bottom of the page) but I can't seem to find any files which are created by the connector itself.
    Second is that when I create a package file it contains files that - I think - shouldn't be included (or at least not in those directories).
    PKGBUILD used:
    pkgname=mysql-connector-c++
    pkgver=1.0.5
    pkgrel=1
    pkgdesc="MySQL Connector/C++ is a MySQL database connector for C++"
    arch=(i686)
    url="http://dev.mysql.com/doc/refman/5.1/en/connector-cpp.html"
    license=('gpl')
    depends=('mysql-clients')
    makedepends=('cmake>=2.4' 'glibc>=2.2.3')
    source=(http://download.softagency.net/MySQL/Downloads/Connector-C++/$pkgname-$pkgver.tar.gz)
    md5sums=('f0ad6655f3ea7db8df3215fa928cba03') #generate with 'makepkg -g'
    build() {
    cd "$srcdir/$pkgname-$pkgver"
    # remove file that is included in release but should be generated by cmake
    rm cppconn/config.h
    # remove some possible old cmake cache
    rm CMakeCache.txt
    # patch for use with gcc-4.4
    patch -p0 < ${startdir}/mysql-connector-cpp-1.0.5-gcc44.patch
    cmake -G "Unix Makefiles" .
    make clean
    make || return 1
    make DESTDIR="$pkgdir/" install
    # vim:set ts=2 sw=2 et:
    output of pacman -Qlp mysql-connector-c++-1.0.5-1-i686.pkg.tar.gz
    mysql-connector-c++ /usr/
    mysql-connector-c++ /usr/local/
    mysql-connector-c++ /usr/local/ANNOUNCEMENT
    mysql-connector-c++ /usr/local/COPYING
    mysql-connector-c++ /usr/local/README
    mysql-connector-c++ /usr/local/include/
    mysql-connector-c++ /usr/local/include/cppconn/
    mysql-connector-c++ /usr/local/include/cppconn/build_config.h
    mysql-connector-c++ /usr/local/include/cppconn/config.h
    mysql-connector-c++ /usr/local/include/cppconn/connection.h
    mysql-connector-c++ /usr/local/include/cppconn/datatype.h
    mysql-connector-c++ /usr/local/include/cppconn/driver.h
    mysql-connector-c++ /usr/local/include/cppconn/exception.h
    mysql-connector-c++ /usr/local/include/cppconn/metadata.h
    mysql-connector-c++ /usr/local/include/cppconn/parameter_metadata.h
    mysql-connector-c++ /usr/local/include/cppconn/prepared_statement.h
    mysql-connector-c++ /usr/local/include/cppconn/resultset.h
    mysql-connector-c++ /usr/local/include/cppconn/resultset_metadata.h
    mysql-connector-c++ /usr/local/include/cppconn/statement.h
    mysql-connector-c++ /usr/local/include/cppconn/warning.h
    mysql-connector-c++ /usr/local/include/mysql_connection.h
    mysql-connector-c++ /usr/local/include/mysql_driver.h
    mysql-connector-c++ /usr/local/lib/
    mysql-connector-c++ /usr/local/lib/libmysqlcppconn-static.a
    mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so
    mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so.1
    mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so.1.0.5
    The files bothering me are:
    /usr/local/ANNOUNCEMENT
    /usr/local/COPYING
    /usr/local/README
    Anyone who can enlighten me?:rolleyes:
    Thanks in advance,
    Arjan Gelderblom
    Last edited by Bloged (2009-11-17 09:27:49)

    Bloged wrote:
    Thanks wonder for your reply.
    How do I move files using PKGBUILD? I've found an install -D command but that looks at best at copying the file:
    install -D COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
    Another question is that the patch that is executed is only for gcc-4.4 is there a way to have an if statement for that?
    no. we don't have any other version in our repo and that patch will work also with older gcc
    Edit: a simple solution is to copy them using install -D and then remove them... is this the correct sollution?
    yes. and remove the others two files as well.

  • How to include the mysql-connector in a simple .jar file

    Well I started up with java again. Just messing around. This project I'm making now is just plain simple, I have a program thats going to read a table in a database from a server I have here at home. It works fine if I do like this: java javafil to run the file, it reads from the database fine.
    But when I made a .jar file out of it using this command: jar cmf manifest.txt javafile.jar *.class
    It won't connect to the database. Or it doesn't print out the rows in the table. So I thought I have to include the mysql-connector with the .jar.
    manifest.txt
    Main-Class: javafile
    Now what is an easy way to do this?
    This program is also going to be run from a computer that might not have the mysql-connector installed on the computer. Like a friend of mine wants to connect to the database and read it.
    I've tried to google "mysql connector in a .jar file" but I get tons of informations about the mysql-connector.jar instead of what I'm looking for.
    Thanks,
    Torbj�rn Svae
    Edited by: LordSvae on 19.jun.2008 14:52

    LordSvae wrote:
    Yeah but the other computer might not have that connector file on their computer. So is there like I way I can use it when it is in the .jar file? Thats kinda what I wanted. You cannot include another JAR in a JAR file. You however can extract it and put the classes in your JAR. Verify the license agreement if it is allowed. Although this is considered as a bad practice (poor upgradebility and maintainability).
    If you don't want to use the -cp parameter, then use the class-path entry of the manifest.mf of your JAR. You can also write a batch file with the whole JAR -cp command in a single line and run the batch file instead.
    Pluss, even though I have the right classpath in the environment variables set, it doesn't work for me either. So I guess it doesn't load the connector when running the .jar file.The classpath environment variable has nothing to do with running JAR's. Forget about it and use the -cp or -classpath parameter.

  • 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.

  • 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.

  • Unable to extract connector/j jar file(mysql)

    im have having a problem on extracting mysql's connector/j jar file on j2sdk1.4.0.
    and may i know does sun allows windows xp users to install various kind of versions of j2sdk? for example, install j2sdk1.4.0 into c:\j2sdk1.4.0, and j2sdk1.4.2_05 into c:\j2sdk1.4.2_05?
    what to do using j2sdk1.4.0 for connector/j?
    i would like to know manual steps instead if automatic step provided by netbean.
    i wish this problem could be solved as sonn as possible

    im have having a problem on extracting mysql's
    connector/j jar file on j2sdk1.4.0.I'm not sure what this means. The MySQL connector JAR isn't part of any JDK. You've got to download it and put it in your CLASSPATH.
    >
    and may i know does sun allows windows xp users to
    install various kind of versions of j2sdk? for
    example, install j2sdk1.4.0 into c:\j2sdk1.4.0, and
    j2sdk1.4.2_05 into c:\j2sdk1.4.2_05?
    what to do using j2sdk1.4.0 for connector/j?
    i would like to know manual steps instead if
    automatic step provided by netbean.
    i wish this problem could be solved as sonn as
    possible

  • 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.

  • 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.

  • 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.

  • 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());
    }

  • Weblogic 10.3 & MySQL Connector

    Hello everyone!
    I use Windows 7 Professional 64x and try to install MySQL connector for Weblogic server, copied mysql-connector-java-commercial-5.1.14-bin.jar to wlserver_10.3\server\lib directory and start my domain. I get an error "Failed to load Main-Class manifest attribute from mysql-connector-java-commercial-5.1.14-bin.jar [https://docs.google.com/file/d/0B5vWbjiK4UUbZGZCdlpWMUVHN2M/edit?usp=sharing]
    Could anybody help me to solve this problem?

    just putting it in the directory doesn't get WLS to add it to the classpath.
    Edit you domain's bin\setDomainEnv script, and add that jar (full path name)
    the the CLASSPATH that script creates.

  • 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.

Maybe you are looking for

  • 0CO_OM_CCA_4 - Data in r/3 for verification (Transaction or tables in r/3)

    Hello I loaded to BI using 0co_om_cca_4 data source.  I would like to know how to verify the data in r/3 for this data source?  I have seen so many postings regarding this, but was unable to use any of them.  Do you know which transaction to use for

  • Problem with RTF Report Generation From OAF Page

    Hi, I have a requirement where from OAF page, on a button click, a RTF report should be generated. Template has been already defined for the same. If I want to generate report in .xls or pdf, it is working fine but in case of RTF it is showing that "

  • Installing Illustrator CS4

    How can I install the program with the least amount of options? I can't uncheck Extension Manager and ExtendScript Toolkit? Are they required?

  • Won't boot to Target Drive when holding "T"

    My iMac won't go into Target Disk mode when I power up and hold down the T key. I am using a newer Apple thin keyboard, but the same thing happens with the original Apple keyboard. It will, however, go to target drive if I use a Kensington keyboard.

  • Buying a new TV and have the old TV picked up for recycle

    Hi, All: I want to buy a new TV from BestBuy for my parents. I wonder if BesBuy can pick up the old TV away for recycle when they deliver the new TV to my parent's home? If the answer is yes, can anyone tell if I need to following specific instructio