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.
Similar Messages
-
Getting the runtime environment to see packages in the jre/lib/ext dir
I've downloaded mysql-connector-java-3.0.6-stable-bin.jar so that i can connect to a mysql database. I can use it fine from tomcat, but when I try and write stand alone stuff I get
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at WebUtils.DatabaseConnection.Query(DatabaseConnection.java:27)
at AddToDatabase.main(AddToDatabase.java:13)
I suspect it could be a classpath related error but I have no idea how to fix it, or even how to set the classpath or view it's current value.
Any ideas,
PeteI've downloaded
mysql-connector-java-3.0.6-stable-bin.jar ...Can we assume you've put it on the JDK/jre/lib/ext dir ?
I suspect it could be a classpath related error but I
have no idea how to fix it, or even how to set the
classpath or view it's current value.Which OS are you using ?
Rafael -
Problem in running a class inside java_home/jre/lib/ext
I have a class file.
I compiled the class and packaged it to a jar file .
Then i place the jar file at java-home/jre/lib/ext
Now when i try to run this file it shows a NoClassDefFoundError
Do i need to set the path in some .properties files.???
please help me out....i think its to do with setting the
java.ext.dirs path
if i compile it with like
java -Djava.ext.dirs=D:\jdk\jre\lib\ext Testthen it works and shows the Classloader as "ExtClassLoader"
But this is a run time setting.
How can i set this property "java.ext.dirs" permanently. -
what is the purpose of alt-rt.jar in jdk1.6.0_20/jre/lib -- 64bit
thanksCould this be because of one of these bugs:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6953058
or
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6959816
Actually the flags from the later bug are not set in our JVM but the crash happened between half an hour or several hours (I expect it was depending on the system load).
Thanks,
Stefan -
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 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 -
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.
-
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());
} -
Need help with mysql-connector-j setup!
I have downloaded and installed Tomcat 5.5 and MySQL Server 5.0 and have both up and running. I then downloaded the MySQL-Connector-J and the folder is located at:
C:\Program Files\Java\jre1.5.0_06\lib\ext\mysql-connector-java-3.1.12
My JSP code looks like this:
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.net.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch (Exception E) {
out.println("Unable to load driver. " + E);
%>And I am getting the folowing error:
java.lang.ClassNotFoundException: com.mysql.jdbc.DriverNow, before anyone tells me to go read other posts, I have already done this and I have tried changing my classpath with no luck. I have tried these locations as my classpath:
C:\Program Files\Java\jre1.5.0_06\lib\ext\mysql-connector-java-3.1.12
C:\Program Files\Java\jre1.5.0_06\lib\ext\mysql-connector-java-3.1.12\mysql-connector-java-3.1.12-bin.jar
Neither of which seem to work. Can anyone figure out what's happening here?Ok, I copied it to the <tomcat dir>/common/lib, but I copied the entire folder (which I'm assuming is necessary), with no luck. So, now the location is:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\mysql-connector-java-3.1.12\mysql-connector-java-3.1.12-bin.jar
Any other suggestions?
Thanks.
null -
Linux JRE and /lib/ext directory
I know this topic is fairly well discussed, but after reading many, many forum posts I have not found an answer. I've tried JRE 1.3.1_03 as well as a completely different JRE, from Blackdown.
If I run java from /jre/bin, on Linux, how does java know where the /lib/ext directory is?
Do I have to have an environment setup, such as java_home or should it find it by relative paths?
What environment variables must be setup for the JRE to operate correctly on Linux(in this case Redhat 7.2)
I have an application and the vendor just says to put these jar's in ext and the JRE will find them. Unfortunately, the JRE does not find them. I just want to make sure my environment is setup correctly.
Thanks,
JamesI'll assume the wording of your response was not meant to be arrogant. lib/etx IS relative and the jars are NOT being found. I'm trying to figure out why.
It looks as though java's bin directory is in your path. Did you have to set that up or did the install set it up for you?
Again, what environment variables on Linux should be setup for the JRE to work properly? Any?
If I run something from the jre/bin directory, like: ./java TestClass, should the runtime be able to find jar's in the jre/lib/ext directory just by relative paths?
Thanks,
James -
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 -
Error occurred while preloading classes of security providers from jre/lib/
Hello all,
We are Upgrading our BW Production System with EHP1 Package.
on the Step DEPLOY_ONLINE_DEPL the Upgrade stops and we get the error message
Error occurred while preloading classes of security providers from jre/lib/ext folder: java.util.zip.ZipException: A file or directory in the path name does not e*
*xist. jar:file:/usr/java14_64/jre/lib/ext/ibmjceprovider.jar
I have checked the file Path and the Permission exist
I have no Idea anymore
Can you help us ?
Best regards
Vito CecereHi Vito,
This issue looks similar to the following thread I believe the problem was with the SAPJSF user
Cannot startup visual administrator due to UME logon client details changed -
I am trying to add jdbc to my project and find that jdbc components seem to be missing
compiles and runs fine in IDE
but when I try to run outside IDE I get this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/netbeans/lib/sql/
DataNavigatorhere is my log file
Log Session: Sunday, May 22, 2005 10:17:39 PM EDT
System Info: Product Version = Sun(tm) Java(tm) Studio Enterprise 7 2004Q4 (Build 041123)
IDE Versioning = IDE/1 spec=4.26.1 impl=041123
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.4.2_05; Java HotSpot(TM) Client VM 1.4.2_05-b04; Sun Microsystems Inc.
Java Home = C:\j2sdk1.4.2_05\jre
System Locale; Encod. = en_US (f4j_ee); Cp1252
Home Dir; Current Dir = C:\Documents and Settings\dale; C:\Sun\jstudio_04Q4\Ent_04Q4\bin
IDE Install; User Dir = C:\Sun\jstudio_04Q4\Ent_04Q4; C:\Documents and Settings\dale\.jstudio\Ent04Q4
CLASSPATH = C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\boot.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\Describe.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\DescribeIDE.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\jaxen.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\logger.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\msv.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\parser.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\saxpath.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\Tidy.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgdtj55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgetj55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsglt55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgltc55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgltjava55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgmtj55.jar;C:\j2sdk1.4.2_05\lib\dt.jar;C:\j2sdk1.4.2_05\lib\tools.jar;C:\Sun\jstudio_04Q4\AppServer7\pointbase\client_tools\lib\pbclient42RE.jar
Boot & ext classpath = C:\j2sdk1.4.2_05\jre\lib\rt.jar;C:\j2sdk1.4.2_05\jre\lib\i18n.jar;C:\j2sdk1.4.2_05\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_05\jre\lib\jsse.jar;C:\j2sdk1.4.2_05\jre\lib\jce.jar;C:\j2sdk1.4.2_05\jre\lib\charsets.jar;C:\j2sdk1.4.2_05\jre\classes;C:\j2sdk1.4.2_05\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.2_05\jre\lib\ext\jai_codec.jar;C:\j2sdk1.4.2_05\jre\lib\ext\jai_core.jar;C:\j2sdk1.4.2_05\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.2_05\jre\lib\ext\localedata.jar;C:\j2sdk1.4.2_05\jre\lib\ext\mlibwrapper_jai.jar;C:\j2sdk1.4.2_05\jre\lib\ext\sunjce_provider.jar
Dynamic classpath = C:\Sun\jstudio_04Q4\Ent_04Q4\lib\patches\TopLogging.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\core.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\openfile-cli.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\openide-loaders.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\openide.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\locale\core_f4j.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\locale\core_f4j_ee.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\locale\openide_f4j.jar
Patched TopLogging from crash-reporter.nbm
[org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module com.sun.xml.registry1_0_01: added = [module org.netbeans.libs.xerces/1 > 1.2] removed = [package org.apache.xerces.parsers[SAXParser], package org.apache.xml.serialize[XMLSerializer]]; details: [Xerces is now available only as an autoload module, not in classpath: http://libs.netbeans.org/#xerces]
[org.netbeans.core.modules #4] Warning: the extension C:\Sun\jstudio_04Q4\Ent_04Q4\modules\autoload\ext\namespace1_3.jar may be multiply loaded by modules: [C:\Sun\jstudio_04Q4\Ent_04Q4\modules\autoload\jaxr-module-1-3.jar, C:\Sun\jstudio_04Q4\Ent_04Q4\modules\autoload\jax-qname-module.jar]; see: http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/classpath.html#class-path
Module patch or custom extension: C:\Sun\jstudio_04Q4\Ent_04Q4\modules\patches\org-netbeans-modules-editor\codetemplatesPatches.jar
[org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module org.netbeans.modules.jarpackager: added = [module org.netbeans.libs.regexp > 1.2] removed = [package org.apache.regexp > 1.2]; details: [Regexp is now available only as an autoload module, not on classpath: http://libs.netbeans.org/#regexp]
[org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module org.netbeans.modules.refactoring: added = [module org.openide.debugger > 1.0, token org.openide.compiler.CompilationEngine, module org.openide.compiler > 1.0, token org.openide.TopManager, module org.openide.execution > 1.0, token org.openide.windows.IOProvider, module org.openide.deprecated > 1.0, token org.openide.execution.ExecutionEngine] removed = []; details: [API separation phase I (#19443): http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I, API separation phase II (#19443): http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-II, Debugger API separation (#29914): http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-III]
[org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module org.netbeans.modules.web.tomcat.tomcat40: added = [module org.netbeans.libs.xerces/1 > 1.2] removed = [package [org.apache.xml.serialize.EncodingInfo]]; details: [Xerces is now available only as an autoload module, not in classpath: http://libs.netbeans.org/#xerces]
[org.netbeans.core.modules #4] Warning - had to add recursive class loader dependencies for module org.netbeans.modules.refactoring on [org.netbeans.modules.classfile]; see http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-indirect-dep-cp
[org.netbeans.core.modules #4] Warning - had to add recursive class loader dependencies for module com.sun.forte4j.j2ee.debugger on [org.openidex.util, org.netbeans.modules.web.core, org.netbeans.modules.schema2beans, org.netbeans.api.xml, org.netbeans.modules.jarpackager, javax.activation, org.netbeans.modules.vcscore, org.netbeans.libs.jaxp, org.netbeans.libs.xerces, org.netbeans.modules.projects, org.netbeans.modules.logger, org.netbeans.modules.html, com.sun.forte4j.j2ee.lib, org.netbeans.modules.clazz, javax.mail, org.netbeans.modules.image, com.sun.forte4j.modules.depclass, org.netbeans.libs.regexp]; see http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-indirect-dep-cp
[org.netbeans.core.modules #6] Warning: the module org.netbeans.modules.jarpackager uses org.netbeans.libs.regexp which is deprecated: JDK 1.4 includes regular expression support which should be used instead: http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.6-jre-regexp
[org.netbeans.core.modules #6] Warning: the module org.netbeans.modules.projects uses org.openide.deprecated which is deprecated: Clients of obsoleted Open APIs are encouraged to remove this dependency. See http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I
[org.netbeans.core.modules #6] Warning: the module org.netbeans.modules.refactoring uses org.openide.deprecated which is deprecated: Clients of obsoleted Open APIs are encouraged to remove this dependency. See http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I
[org.netbeans.core.modules #6] Warning: the module com.embarcadero.netbeans uses org.openide.deprecated which is deprecated: Clients of obsoleted Open APIs are encouraged to remove this dependency. See http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I
[org.netbeans.core.modules #6] Warning: the module com.sun.forte4j.j2ee.debugger uses org.openide.deprecated which is deprecated: Clients of obsoleted Open APIs are encouraged to remove this dependency. See http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I
Type Groups Level Module Name
err * 255 * (Default)
Type Groups Level Module Name
err * 255 * (Default)
cfg 9 255 com.sun.forte4j.webdesigner
Last execution suffered an abnormal exit at Sunday, May 22, 2005 10:15:18 PM EDT
Log file not specified
Turning on modules:
org.openide/1 [4.26.1 041123]
org.openide.loaders [4.11.1 041123]
org.netbeans.core/1 [1.21.1 041123]
org.openide.io [1.1.1 041123]
org.netbeans.lib.terminalemulator [1.1.1 041123]
org.netbeans.core.output/1 [1.1.1 041123]
com.sun.tools.ide.collab/1 [7.0.0 041123]
com.sun.im [7.0.0 041123]
org.openide.src [1.1.1 041123]
org.openide.execution [1.1.1 041123]
org.openide.compiler [1.2.1 041123]
org.netbeans.core.compiler/1 [1.4.1 041123]
org.openide.debugger [1.1.1 041123]
org.netbeans.modules.editor/1 [1.14.1 041123]
org.netbeans.libs.xalan/1 [1.4.1 2.5.2]
org.netbeans.libs.jaxp/1 [1.2.1 1.1.2]
org.netbeans.api.xml/1 [1.3.1.3.6.0 3.6.0 041123]
org.netbeans.modules.xml.core/2 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.xml.text/2 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.classfile/1 [1.8 041123]
org.netbeans.core.execution/1 [1.3.1 041123]
org.netbeans.modules.clazz/1 [1.13.1 041123]
org.netbeans.modules.javahelp/1 [2.1.1 041123]
org.netbeans.modules.db/1 [1.8.2 041123]
com.sun.forte4j.modules.dbmodel.jdbcimpl/1 [7.0.0 041123]
org.openide.deprecated [1.3.1 041123]
org.netbeans.core.deprecated [1.3.1 041123]
org.netbeans.modules.debugger.core/3 [2.10.1 041123]
org.netbeans.modules.debugger.jpda/1 [1.17.1 041123]
org.netbeans.modules.j2eeserver/2 [1.7.3 041123]
org.apache.xalan [2.2.2 Xalan 2.2.0 release]
org.netbeans.modules.image/1 [1.11.1 041123]
javax.activation/1 [1.0.2 1.0.2]
javax.mail/1 [1.1.4 1.1.4]
org.netbeans.modules.logger/1 [1.5 041123]
com.sun.forte4j.modules.depclass/1 [2.4 041123]
org.openidex.util/2 [2.7.1 041123]
org.netbeans.modules.vcscore/1 [1.9.1 041123]
org.netbeans.libs.regexp [1.2.1 1.2]
org.netbeans.modules.jarpackager/2 [1.13.3 041123]
org.netbeans.modules.schema2beans/1 [1.4.3 041123]
org.netbeans.api.java/1 [1.3.1 041123]
org.netbeans.libs.xerces/1 [1.4.1 2.6.0]
org.netbeans.modules.java/1 [1.16.1 041123]
com.sun.ffj.modules.licensemgr/1 [7.0.0 041123]
com.sun.forte4j.j2ee.lib/1 [7.0.0 041123]
com.sun.forte4j.j2ee.ejb/1 [7.0.0 041123]
com.sun.forte4j.j2ee.ejbmodule/1 [7.0.0 041123]
org.netbeans.modules.projects/1 [1.14.1 041123]
org.netbeans.modules.html/1 [1.12.1 041123]
org.netbeans.modules.web.core/1 [1.16.3 041123]
com.sun.forte4j.j2ee.appasm/1 [7.0.0 041123]
com.sun.forte4j.j2ee.appclient/1 [7.0.0 041123]
com.sun.forte4j.j2ee.j2eeconn/1 [7.0.0 041123]
com.sun.forte4j.j2ee.importear/1 [7.0.0 041123]
org.netbeans.modules.diff/1 [1.7.1 041123]
org.netbeans.modules.vcs.advanced/1 [1.9.1 041123]
org.netbeans.modules.vcs.profiles.clearcase/1 [1.2 041123]
org.netbeans.modules.xml.catalog/2 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.properties/1 [1.11.1 041123]
org.netbeans.modules.i18n/1 [1.14.1 041123]
org.netbeans.modules.javadoc/1 [1.11.1 041123]
javax.xml.namespace/1 [1.0 1.0]
com.sun.xml.messaging1_3/1 [1.0 1.0]
com.sun.xml.registry1_3/1 [1.0 1.0]
com.sun.tools.jaxrpc_cmn/1 [1.1 1.1]
com.sun.xml.rpc1_3/1 [1.0 1.0]
com.sun.forte4j.j2ee.wsdl/1 [7.0.0 041123]
org.netbeans.modules.servletapi23/1 [1.3.2 041123]
org.netbeans.modules.web.jspparser/1 [1.5.2 041123]
org.netbeans.modules.web.tomcat.tomcat40/1 [1.8.3 041123]
com.sun.forte4j.genericgenerator4/1 [1.1.1 020327]
org.netbeans.modules.web.ie/1 [1.15.3 041123]
com.sun.forte4j.webdesigner.xmlservice/1 [7.0.0 041123]
com.sun.tools.ide.j2eeant/1 [7.0.0 041123]
org.netbeans.modules.xml.schema/1 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.filecopy/1 [1.11 041123]
org.netbeans.modules.group/1 [1.0.1 041123]
org.netbeans.modules.settings/1 [1.4.1 041123]
org.netbeans.tasklistapi/1 [1.7.1.2 2 041123]
org.netbeans.modules.tasklist.core/2 [1.22.1.26 6 041123]
org.netbeans.modules.suggestions_framework/2 [1.2.1.265 5 041123]
org.netbeans.modules.tasklist.docscan/2 [1.13.1.2653 3 041123]
com.sun.forte4j.codetemplates/1 [7.0.0 @BUILD_NUMBER_SUBST@]
com.sun.tools.vcsscc/1 [7.0.0 041123]
com.sun.tools.vcsscc.profiles.vss/1 [7.0.0 041123]
com.sun.forte4j.modules.pointbase/1 [7.0.0 041123]
org.netbeans.core.windows/2 [2.0.1 041123]
org.netbeans.core.ui/1 [1.3.1 041123]
org.netbeans.modules.utilities/1 [1.15.1 041123]
org.netbeans.modules.autoupdate/1 [2.8.1 041123]
org.netbeans.modules.welcome/1 [1.5.1 041123]
org.apache.soap [2.2.1 SOAP 2.2 release]
org.netbeans.lib.cvsclient/1 [1.8.1 041123]
org.netbeans.modules.vcs.profiles.cvsprofiles/1 [1.3.1 041123]
org.netbeans.modules.applet/1 [1.14.1 041123]
org.netbeans.modules.web.debug/1 [1.8.2 041123]
org.netbeans.modules.web.core.syntax/1 [1.12.3 041123]
com.sun.jato.tools.sunone.ee/1 [2.1.4 20041123.213634]
org.netbeans.modules.usersguide/1 [1.13.1 041123]
com.sun.forte4j.ee_examples/1 [7.0.0 041123]
org.netbeans.modules.css/2 [1.1.1.3.6.0 3.6.0 041123]
com.sun.tools.j2mews/1 [7.0.0 041123]
org.ksoap/1 [1.0.1 kSOAP release 1.0]
org.netbeans.modules.vcs.cmdline.compat/1 [1.3.1 041123]
org.netbeans.modules.form/2 [1.13.1 041123]
com.sun.tools.ide.collab.channel.mdc/1 [7.0.0 041123]
org.netbeans.modules.servletapi/1 [1.3.1 041123]
org.netbeans.modules.web.taglibed/1 [1.11.3 041123]
com.sun.tools.dbdrivers/1 [7.0.0 041123]
org.netbeans.modules.refactoring/1 [7.0.0 041123]
org.netbeans.modules.web.assemblee/1 [1.2.1 041123]
com.sun.tools.ide.portal.portlet/1 [1.0 041123]
com.sun.tools.crashreporter [7.0.0 041123]
org.netbeans.modules.text/1 [1.12.1 041123]
com.embarcadero.netbeans/2 [1.0 041123]
com.sun.tools.modules.cvsdisabler/1 [7.0.0 041123]
com.sun.tools.vcsscc.profiles.pvcs/1 [7.0.0 041123]
com.sun.tools.ide.collab.channel.chat/1 [7.0.0 041123]
org.netbeans.modules.i18n.form/2 [1.12 041123]
org.netbeans.modules.properties.syntax/1 [1.11 041123]
org.netbeans.modules.cvsclient/1 [2.0.1 041123]
com.sun.tools.ide.collab.channel.filesharing/1 [7.0.0 041123]
com.sun.forte4j.j2ee.ejbtest/1 [7.0.0 041123]
org.netbeans.modules.httpserver/1 [1.13.1 041123]
org.netbeans.modules.jdbc/1 [7.0.0 041123]
com.sun.jdo.modules.persistence.mapping.core/1 [7.0.0 041123]
com.sun.jdo.modules.persistence.mapping.ejb/1 [7.0.0 041123]
org.netbeans.modules.web.tomcat.tomcat40.autocompile/1 [7.0.0 041123]
org.netbeans.modules.junit/2 [2.11.1 041123]
com.sun.ffj.modules.registration/1 [7.0.0 041123]
org.netbeans.modules.xsl/1 [1.1.1.3.6.0 3.6.0 041123]
com.sun.forte4j.webdesigner.jwsdp/1 [7.0.0 041123]
org.netbeans.modules.extbrowser/1 [1.3.1 041123]
com.sun.forte4j.j2ee.debugger/1 [7.0.0 041123]
com.sun.xml.messaging1_0_01/1 [1.0 1.0]
com.sun.xml.rpc1_0_01/1 [1.0 1.0]
org.netbeans.modules.web.monitor/1 [1.8.3 041123]
org.netbeans.core.ide/1 [1.3.1 041123]
org.apache.tools.ant.module/3 [3.6.1 041123]
javax.portlet/1 [1.0 041123]
org.netbeans.modules.autoupdateffj/1 [7.0.0 041123 ]
com.sun.tools.profiler.monitor [7.2.4 041123]
org.netbeans.modules.beans/1 [1.11.1 041123]
com.sun.enterprise.webserver.tools/1 [7.0.0 PLUGINVERSION]
com.sun.portal.devtool/1 [1.0 041123]
com.sun.tools.ide.collab.ui/1 [7.0.0 041123]
org.netbeans.modules.xml.tax/2 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.xml.tools/2 [1.1.1.3.6.0 3.6.0 041123]
com.sun.appserv.tools.forte/1 [7.0.0 041123]
org.netbeans.modules.web.dd.editors/1 [1.1.2 041123]
QuantumAutoupdateModule 1116814706515 starting check
Warning - org.netbeans.modules.projects.SetMainClassCookieAction should override CallableSystemAction.asynchronous() to return false
Warning - org.netbeans.modules.debugger.delegator.DefaultDebuggerType should have overridden startDebugger(DataObject,boolean); falling back on deprecated ExecInfo usage; see: http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-II-ExecInfo -
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.
%
Maybe you are looking for
-
Who can I talk to that can help me decide Edge over Contracts and new phones?
My phone is due for an upgrade. I have two other phones on my contract but their phones aren't eligible until July 14 and June 15. I want a breakdown of both the contract more everything plan and the edge more everything plan. I would like to try and
-
How do I export a menu created in Premiere Pro CS5 to Adobe Encore CS5?
Hey everyone, First time in here. Trying some new things in CS5. Anyway, I created a working DVD menu in Photoshop and brought it into Premiere to lay in some video and music. The video is an inset that moves from left to right and sits atop the b
-
i have a MacBook Pro 15-inch Late 2011 (mountain lion) and wondered whether it can run power nap
-
I have deleted my App Store. How do I get it back again?
I have deleted my App Store. Can someone tell me how to get it back?
-
How can i stop recovery. my phone is stuck in the middle
how can i stop recovery in my iphone 4s? i haven't backit up yet but due to wifi interruption it didn't go through. can i undo it?