gcj 4.2.1 entails "Unexpe
To: comp.lang.java.databases
Hi!
I wrote a java-application that uses mysql-connector-java-5.1.6-
bin.jar and does well as long as Java(TM) 2 Runtime Environment,
Standard Edition (build 1.5.0_15-b04) executes the bytecode. I tried
to gain some extra-speed by compiling native.
The compiling works well again but starting the native code leads into
an error: =93Unexpected exception encountered during query=94. I searched
the web for a while but did not find a useful hint so I'd really
appreciate your advise where to search.
Is the connector not designed to be used for compiling native code? Or
is there a way to modify my Java-Code?
Thanks in advance
Christian
Java-Source
===========
System.out.print("Loading driver " + DATABASE_DRIVER + " ... ");
try {
Class.forName(DATABASE_DRIVER);
}
catch (ClassNotFoundException classNotFoundException) {
throw new
InstantiationError(classNotFoundException.getMessage());
}
System.out.println("loaded");
System.out.print("Connecting to " + server + " ... ");
try {
String url = "jdbc:mysql://" + server + ':' + port + "/?user=" +
userName;
if ((passWord != null) && (passWord.trim().length() > 0))
url = url + "&password=" + passWord.trim();
System.out.print("via " + url + " ");
connection = DriverManager.getConnection(url);
}
catch (SQLException sqlException) {
throw new InstantiationError(sqlException.getMessage());
}
System.out.println("connected");
Java-VM coping with the code
==========================
===
java version "1.5.0_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) Client VM (build 1.5.0_15-b04, mixed mode)
CLASSPATH
=========
.:/home/kruggel/public_html/freedb2mysql/mysql-connector-java-5.1.6-
bin.jar
Application works fine with VM
==========================
=====
java freedb2mysql.Starter -dbHost 10.0.0.11 -queryServerForArtist AC%DC -d=
bUser freedb -dbName freedbsmall
Loading driver com.mysql.jdbc.Driver ... loaded
Connecting to 10.0.0.11 ... via jdbc:mysql://10.0.0.11:3306/?
user=freedb connected
Querying freedbsmall (2084153 entries) for disks by artists named AC
%DC
GCJ that compiles fine as well
==========================
=====
gcj (GCC) 4.2.1 (SUSE Linux)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
gcj -v -B /home/kruggel/src/freedb freedb2mysql/*.java freedb2mysql/
data/*.java freedb2mysql/extraction/*.java freedb2mysql/retrieval/
*.java freedb2mysql/spooling/*.java freedb2mysql/textanalysis/*.java
freedb2mysql/util/*.java freedb2mysql/validation/*.java -o
FreeDB2MySQL --main=freedb2mysql.Starter
Native application crashes
==========================
=
./FreeDB2MySQL -dbHost 10.0.0.11 -queryServerForArtist AC%DC -dbUser freed=
b -dbName freedbsmall
Loading driver com.mysql.jdbc.Driver ... loaded
Connecting to 10.0.0.11 ... via jdbc:mysql://10.0.0.11:3306/?
user=freedb
Failed to create MySQLConnector
Unexpected exception encountered during query.
BOOOOSH!
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24