Mysql-connector-java
Hello with all
I have only one question, how to install mysql-connector-java under the archlinux, because I have to seek, is I do not have to find, it is for me to make a test with opencms, I seek a howto more precisely,
thank you
MM:/
regarde sur le site d'openSI, c'est un logiciel de compta open source et il utilise ce connector.
a l'époque j'avais éssayé mais leur application ne semblait pas en vouloir..
dans l'idée c'est un copier/coller et une modif dans httpd.conf, un fichier workers.xx aussi a creer.
peut etre que sur les sites mysql et apache tu trouveras de l'aide.
fin de mes souvenirs
Similar Messages
-
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. -
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 AMAndrew,
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. -
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 meThat looks like it might be a binary-distribution JAR that you should unjar. The actual JAR for the classpath is probably inside it.
-
Getting connection error on windows xp with connector-java-3.1.10 for Mysql
Hi,
I am using Mysql 4.1.13 with Tomcat 5 and Connector mysql-connector-java-3.1.10 on Windows XP machine. When I try to update the table in batch mode sometimes( When server is idle for a long time) get following error.
ERROR [com.userdefined.SchedulerJobs.DownloadDssPresetJob] com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)
=ERROR [com.userdefined.SchedulerJobs.DownloadDssPresetJob] com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
=ERROR [com.userdefined.SchedulerJobs.DownloadDssPresetJob] com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
=ERROR [com.userdefined.SchedulerJobs.DownloadDssPresetJob] com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
=ERROR [com.userdefined.SchedulerJobs.DownloadDssPresetJob] com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
com.mysql.jdbc.Statement.execute(Statement.java:529)
I also get the following error :
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Software caused connection abort: recv failed
STACKTRACE:
java.net.SocketException: Software caused connection abort: recv failed
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:105)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:148)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:176)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1899)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2348)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2858)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:822)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
at com.userdefined.DatabaseMapping.DatabaseParser.getColumns(DatabaseParser.java:388)
at com.userdefined.DatabaseMapping.Table.<init>(Table.java:62)
at com.userdefined.DatabaseMapping.DBMapping.parseAndSave(DBMapping.java:185)
at com.userdefined.SchedulerJobs.DownloadDssNewJob.downloadJob(DownloadDssNewJob.java:404)
at com.userdefined.SchedulerJobs.DownloadDssNewJob.execute(DownloadDssNewJob.java:113)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
I have searched the web for the same but could not come up with the exact solution.
Please help me with the same.
Regards,
veenaAnd, according to this release note:
http://java.sun.com/j2se/1.4.2/docs/guide/swing/SwingChanges.html#4668963
...sounds like exactly what you are seeing.
Metal Can Now Pick up Font Sizes from the Desktop on Microsoft Windows
The bugtraq reports that correspond to this change are: 4419964 and 4668963.
Prior to this release, the DefaultMetalTheme ignored the font size information from the Windows desktop. As of release 1.4.1, DefaultMetalTheme can use the font sizes specified in the Windows desktop. This can be disabled using the system property swing.useSystemFontSettings. An additional part of this bug is that our Windows look and feel was picking up the wrong fonts for a handful of components; this has been fixed. -
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.
% -
MySQL and Java - getting program to work
I am setting up mysql to run sql from a Java program on my pc at home and probably biting off more than I can chew. I get these messages when executing the java program ExecuteSQL.java:
Exception in thread "main" java.lang.NoClassDefFoundError: Test2 <wrong name: MyProjects/test2/Test2>
at java.lang.ClassLoader.defineClass0<Native Method>
at java.lang.ClassLoader.defineClass<Unknown Source>
at java.security.SecurityClassLoader.defineClass<Unknown Source>
at java.net.URLClassLoader.defineClass<Unknown Source>
at java.net.URLClassLoader.access$100<Unknown Source>
at java.net.URLClassLoader$1.run<Unknown Source>
at java.security.AccessController.ddPrivileged<Native Method>
at java.lang.ClassLoader.findClass<Unknown Source>
at java.lang.ClassLoader.loadClass<Unknown Source>
at sun.misc.Launcher$AppClassLoader.loadClass<Unknown Source>
at java.lang.ClassLoader.loadClass<Unknown Source>
at java.lang.ClassLoader.loadClassInternal<Unknown Source>
This is what I did.
I created a folder on my C: drive named MySQL.
I downloaded these two zip files form the MySQL website
* mysql-connector-java-3.0.11-stable
* mysql-4.0.18-win.zip
Installed both of these in folder MySQL.
I modified this line in the program ("ExecuteSQL" 1st pgm in chapter 17) I got from "Java Examples In a Nutshell" and compiled it into directory jwork.
String driver = "com.mysql.jdbc.driver", url = "jdbc:mysql://", user = "", password = "";
The readme file talks about putting a jar file in $JAVA_HOME/jre/lib/ext.
the word "Java_Home" (I now know) is not literally the name but represents the
name of the folder where the JDK to be used exists. So I put a copy of
mysql-connector-java-3.0.11-stable-bin.jar in folder C:\JDK14/jre/lib/ext.
Then I get a ClassNotFoundException error com.mysql.jdbc.driver.
After finding
http://forum.java.sun.com/thread.jsp?forum=31&thread=439796
and
http://forum.java.sun.com/thread.jsp?forum=31&thread=499888
and others, I copied (a second copy) the jar file to the directory where I am create my java objects.
Then I unzipped it to that directory, creating three folders that hold the unzipped objects.
I tried executing the program again. I get the messages at the top of this post.
The Manifest file is in one of the three folders unzipped to my java work directory.
In the second of the two above threads, jsalonen says:
the problem can be solved by mentioning mysql.jar in the Class-Path attribute
in the manifest of the jar file:
In this "manifest" file, there are only three lines and I added a fourth and it looks like this
(there are two, one in directory MySQL\META-INF and one in directory jwork\META-INF:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.1
Created-By: 1.4.0_01-b03 (Sun Microsystems Inc.)
Main-Class:jwork\ExecuteSQL
How do I "mention" mysql.jar in the class path attribute?
In the index.list file (in the directory with the manifest file, do I need to add anything to refer that "com.mysql.jdbc.driver" is the driver?
Do I need index.list in MySQL\META-INF ?
Thank you for your help. The program ExecuteSQL follows.
* Copyright (c) 2000 David Flanagan. All rights reserved.
* This code is from the book Java Examples in a Nutshell, 2nd Edition.
* It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied.
* You may study, use, and modify it for any non-commercial purpose.
* You may distribute it non-commercially as long as you retain this notice.
* For a commercial use license, or to purchase the book (recommended),
* visit http://www.davidflanagan.com/javaexamples2.
/** package com.davidflanagan.examples.sql; */
import java.sql.*;
import java.io.*;
* A general-purpose SQL interpreter program.
public class ExecuteSQL {
public static void main(String[] args) {
Connection conn = null; // Our JDBC connection to the database server
try {
String driver = "com.mysql.jdbc.driver", url = "jdbc:mysql://",
user = "", password = "";
// Parse all the command-line arguments
for(int n = 0; n < args.length; n++) {
if (args[n].equals("-d")) driver = args[++n];
else if (args[n].equals("-u")) user = args[++n];
else if (args[n].equals("-p")) password = args[++n];
else if (url == null) url = args[n];
else throw new IllegalArgumentException("Unknown argument.");
// The only required argument is the database URL.
if (url == null)
throw new IllegalArgumentException("No database specified");
// If the user specified the classname for the DB driver, load
// that class dynamically. This gives the driver the opportunity
// to register itself with the DriverManager.
if (driver != null) Class.forName(driver);
// Now open a connection the specified database, using the
// user-specified username and password, if any. The driver
// manager will try all of the DB drivers it knows about to try to
// parse the URL and connect to the DB server.
conn = DriverManager.getConnection(url, user, password);
// Now create the statement object we'll use to talk to the DB
Statement s = conn.createStatement();
// Get a stream to read from the console
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
// Loop forever, reading the user's queries and executing them
while(true) {
System.out.print("sql> "); // prompt the user
System.out.flush(); // make the prompt appear now.
String sql = in.readLine(); // get a line of input from user
// Quit when the user types "quit".
if ((sql == null) || sql.equals("quit")) break;
// Ignore blank lines
if (sql.length() == 0) continue;
// Now, execute the user's line of SQL and display results.
try {
// We don't know if this is a query or some kind of
// update, so we use execute() instead of executeQuery()
// or executeUpdate() If the return value is true, it was
// a query, else an update.
boolean status = s.execute(sql);
// Some complex SQL queries can return more than one set
// of results, so loop until there are no more results
do {
if (status) { // it was a query and returns a ResultSet
ResultSet rs = s.getResultSet(); // Get results
printResultsTable(rs, System.out); // Display them
else {
// If the SQL command that was executed was some
// kind of update rather than a query, then it
// doesn't return a ResultSet. Instead, we just
// print the number of rows that were affected.
int numUpdates = s.getUpdateCount();
System.out.println("Ok. " + numUpdates +
" rows affected.");
// Now go see if there are even more results, and
// continue the results display loop if there are.
status = s.getMoreResults();
} while(status || s.getUpdateCount() != -1);
// If a SQLException is thrown, display an error message.
// Note that SQLExceptions can have a general message and a
// DB-specific message returned by getSQLState()
catch (SQLException e) {
System.err.println("SQLException: " + e.getMessage()+ ":" +
e.getSQLState());
// Each time through this loop, check to see if there were any
// warnings. Note that there can be a whole chain of warnings.
finally { // print out any warnings that occurred
SQLWarning w;
for(w=conn.getWarnings(); w != null; w=w.getNextWarning())
System.err.println("WARNING: " + w.getMessage() +
":" + w.getSQLState());
// Handle exceptions that occur during argument parsing, database
// connection setup, etc. For SQLExceptions, print the details.
catch (Exception e) {
System.err.println(e);
if (e instanceof SQLException)
System.err.println("SQL State: " +
((SQLException)e).getSQLState());
System.err.println("Usage: java ExecuteSQL [-d <driver>] " +
"[-u <user>] [-p <password>] <database URL>");
// Be sure to always close the database connection when we exit,
// whether we exit because the user types 'quit' or because of an
// exception thrown while setting things up. Closing this connection
// also implicitly closes any open statements and result sets
// associated with it.
finally {
try { conn.close(); } catch (Exception e) {}
* This method attempts to output the contents of a ResultSet in a
* textual table. It relies on the ResultSetMetaData class, but a fair
* bit of the code is simple string manipulation.
static void printResultsTable(ResultSet rs, OutputStream output)
throws SQLException
// Set up the output stream
PrintWriter out = new PrintWriter(output);
// Get some "meta data" (column names, etc.) about the results
ResultSetMetaData metadata = rs.getMetaData();
// Variables to hold important data about the table to be displayed
int numcols = metadata.getColumnCount(); // how many columns
String[] labels = new String[numcols]; // the column labels
int[] colwidths = new int[numcols]; // the width of each
int[] colpos = new int[numcols]; // start position of each
int linewidth; // total width of table
// Figure out how wide the columns are, where each one begins,
// how wide each row of the table will be, etc.
linewidth = 1; // for the initial '|'.
for(int i = 0; i < numcols; i++) { // for each column
colpos[i] = linewidth; // save its position
labels[i] = metadata.getColumnLabel(i+1); // get its label
// Get the column width. If the db doesn't report one, guess
// 30 characters. Then check the length of the label, and use
// it if it is larger than the column width
int size = metadata.getColumnDisplaySize(i+1);
if (size == -1) size = 30; // Some drivers return -1...
if (size > 500) size = 30; // Don't allow unreasonable sizes
int labelsize = labels.length();
if (labelsize > size) size = labelsize;
colwidths[i] = size + 1; // save the column the size
linewidth += colwidths[i] + 2; // increment total size
// Create a horizontal divider line we use in the table.
// Also create a blank line that is the initial value of each
// line of the table
StringBuffer divider = new StringBuffer(linewidth);
StringBuffer blankline = new StringBuffer(linewidth);
for(int i = 0; i < linewidth; i++) {
divider.insert(i, '-');
blankline.insert(i, " ");
// Put special marks in the divider line at the column positions
for(int i=0; i<numcols; i++) divider.setCharAt(colpos[i]-1,'+');
divider.setCharAt(linewidth-1, '+');
// Begin the table output with a divider line
out.println(divider);
// The next line of the table contains the column labels.
// Begin with a blank line, and put the column names and column
// divider characters "|" into it. overwrite() is defined below.
StringBuffer line = new StringBuffer(blankline.toString());
line.setCharAt(0, '|');
for(int i = 0; i < numcols; i++) {
int pos = colpos[i] + 1 + (colwidths[i]-labels[i].length())/2;
overwrite(line, pos, labels[i]);
overwrite(line, colpos[i] + colwidths[i], " |");
// Then output the line of column labels and another divider
out.println(line);
out.println(divider);
// Now, output the table data. Loop through the ResultSet, using
// the next() method to get the rows one at a time. Obtain the
// value of each column with getObject(), and output it, much as
// we did for the column labels above.
while(rs.next()) {
line = new StringBuffer(blankline.toString());
line.setCharAt(0, '|');
for(int i = 0; i < numcols; i++) {
Object value = rs.getObject(i+1);
if (value != null)
overwrite(line, colpos[i] + 1, value.toString().trim());
overwrite(line, colpos[i] + colwidths[i], " |");
out.println(line);
// Finally, end the table with one last divider line.
out.println(divider);
out.flush();
/** This utility method is used when printing the table of results */
static void overwrite(StringBuffer b, int pos, String s) {
int slen = s.length(); // string length
int blen = b.length(); // buffer length
if (pos+slen > blen) slen = blen-pos; // does it fit?
for(int i = 0; i < slen; i++) // copy string into buffer
b.setCharAt(pos+i, s.charAt(i));Don't put those JARs in the lib/ext directory. Only language extensions (e.g., packages that start with "javax") belong in there.
Learn how to set the CLASSPATH properly for starters:
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html
You might want to look at the JDBC tutorial, too:
http://java.sun.com/docs/books/tutorial/jdbc/
Do one thing at a time. Get the program to work, then worry about packaging it into an executable JAR. -
Hi,
can you do me a favor got the following exception when I run the below code in the JBuilder4.
java.lang.NoClassDefFoundError: java/sql/Savepoint
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at ucsc.Connect.main(Connect.java:17)
Exception in thread "main"
and When I run this program in the command prompt, I got the following exception
D:\>java Connect
Exception in thread "main" java.lang.NoClassDefFoundError: Connect
D:\>
I set CLASSPATH as %JAVA_HOME%\lib\jre\ mysql-connector-java-5.0.4-bin in the Environmental variables.
Can anyone please tell me the reason for that.
Code
Thanks
import java.sql.*;
public class Connect
public static void main (String[] args)
Connection conn = null;
try
String userName = "root";
String password = "";
String url = "jdbc:mysql://localhost:3306/ucsc";
// ucsc is the database name
Class.forName ("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(url,"root","");
System.out.println ("Database connection established");
catch (Exception e)
System.err.println ("Cannot connect to database server");
finally
if (conn != null)
try
conn.close ();
System.out.println ("Database connection terminated");
catch (Exception e)
}Hi
Now I got the following message for that code
D:\>javac Connect.java
D:\>java Connect
Cannot connect to database server
D:\>
my code
import java.sql.*;
import javax.sql.*;
public class Connect
public static void main (String[] args)
Connection conn = null;
try
String userName = "root";
String password = "";
String url = "jdbc:mysql://localhost:3306/ucsc";
Class.forName ("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");
catch (Exception e)
System.err.println ("Cannot connect to database server");
finally
if (conn != null)
try
conn.close ();
System.out.println ("Database connection terminated");
catch (Exception e) { /* ignore close errors */ }
}can you tell me the where the error is
Thanks -
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. -
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. -
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 -
Can't instal mysql connector extension for libreoffice
I am trying to install a mysql native connector on libreoffice but I get an error during installation:
"loading component library failed: file:///home.../uno_packages/cache/uno_packages/lu2gkbw6.tmp_/mysql-connector-ooo-1.0.1-linux-intel.oxt/mysqlc.uno.so"
First I thought it was incompatible with LibreOffice 3.4 as it is an OpenOffice.org extension actually, but I tried and it works at least on windows installtion.
Has anyone encountered this?You would think by now that people would know.
Tomcat (and any other application server) has its own ideas about Classpath. This is necessary so that each web application can have its own individual classpath setup.
The classpath for a web application is
- WEB-INF/classes
- jar files in WEB-INF/lib
- shared jar files. eg in Tomcat jar files in /common/lib and /shared/lib
Setting the system classpath will NOT affect the classpath of a web application.
To solve your problem:
Put mysql-connector-java-3.1.12-bin.jar in your WEB-INF/lib directory.
At that point the class should be found.
Even better set up a JNDI datasource in Tomcat and use that:
http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html
Better again: Don't put sql code into a JSP. It doesn't belong there.
meh,
evnafets
Maybe you are looking for
-
Find developer determination depending of ibase on charm
Hi guys! First, let me explanin that I can't resolve that associating it on partner IBASE because the developer determination depending of the change manager first, and then if that criterion is not met depending of IBASE component. To resolve the fi
-
When using EyeTV must you have it hooked up to cable?
I went to this website and found good info on the blog. http://www.nalens.com Can I please ask. When using your EyeTV you must have it hooked up to the cable as well correct? Thank you. Tom < Moved and Edited by Host >
-
Video flickering when published live from camera
I am getting flickered image when published from live camera. Settings done for view of flash player in html page and settings done before publishing in actionscript is as follows: setting in HTML: size of flash player object in html page is 240*180
-
How to change file type restrictions
In Synchronization log, some of my files are not synchronizing because they are being restricted by file type. I am unsure of how to change this restriction in the admin console for iFolder 3.8.4. This is not a file SIZE restriction but file TYPE
-
Help please !! Need to insert date automatically in form
I have been trying unsuccessfully for a week to automatically capture today's date on a form. I can display a date on screen but it will not insert date into mySQL db. All other information is inserted as expected. Am I just whistling in dark? Is the