Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > gcj 4.2.1 entai...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 3749 of 3876
Post > Topic >>

gcj 4.2.1 entails "Unexpected exception encountered during query"

by Christian <java@[EMAIL PROTECTED] > May 14, 2008 at 12:12 PM

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=92d 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

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 =3D "jdbc:mysql://" + server + ':' + ****t + "/?user=3D" +
userName;
     if ((passWord !=3D null) && (passWord.trim().length() > 0))
          url =3D url + "&password=3D" + passWord.trim();
     System.out.print("via " + url + " ");
     connection =3D DriverManager.getConnection(url);
}
catch (SQLException sqlException) {
     throw new InstantiationError(sqlException.getMessage());
}

System.out.println("connected");

Java-VM coping with the code
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
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
=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2E:/home/kruggel/public_html/freedb2mysql/mysql-connector-java-5.1.6-
bin.jar

Application works fine with VM
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> 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=3Dfreedb connected
Querying freedbsmall (2084153 entries) for disks by artists named AC
%DC

GCJ that compiles fine as well
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
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=3Dfreedb2mysql.Starter

Native application crashes
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
> ./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=3Dfreedb
Failed to create MySQLConnector
Unexpected exception encountered during query.

BOOOOSH!
 




 6 Posts in Topic:
gcj 4.2.1 entails "Unexpected exception encountered during query
Christian <java@[EMAIL  2008-05-14 12:12:33 
Re: gcj 4.2.1 entails "Unexpected exception encountered during q
=?windows-1252?Q?Arne_Vaj  2008-05-14 19:42:44 
Re: gcj 4.2.1 entails "Unexpected exception encountered during q
Lew <lew@[EMAIL PROTEC  2008-05-14 23:38:14 
Re: gcj 4.2.1 entails "Unexpected exception encountered during q
Silvio Bierman <sbierm  2008-05-15 10:38:45 
Re: gcj 4.2.1 entails "Unexpected exception encountered during q
=?UTF-8?B?QXJuZSBWYWpow7h  2008-05-15 17:51:10 
Re: gcj 4.2.1 entails "Unexpected exception encountered during q
=?UTF-8?B?QXJuZSBWYWpow7h  2008-05-15 17:53:09 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 22:32:39 CST 2008.