Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #107

gcj 4.2.1 entails "Unexpe

From "Christian" <christian@THRWHITE.remove-dii-this>
Subject gcj 4.2.1 entails "Unexpe
Message-ID <93f8010b-d8ac-404f-958c-afde222e88e2@y21g2000hsf.googlegroups.com> (permalink)
Newsgroups comp.lang.java.databases
Date 2011-04-27 15:21 +0000
Organization TDS.net

Show all headers | View raw


  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: “Unexpected exception encountered during query”. 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 -dbUser 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 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
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

Back to comp.lang.java.databases | Previous | NextNext in thread | Find similar


Thread

gcj 4.2.1 entails "Unexpe "Christian" <christian@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: gcj 4.2.1 entails "Un "=?windows-1252?Q?Arne_Vaj" <=?windows-1252?q?arne_vaj@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
    Re: gcj 4.2.1 entails "Un "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: gcj 4.2.1 entails "Un "Silvio Bierman" <silvio.bierman@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
        Re: gcj 4.2.1 entails "Un "=?UTF-8?B?QXJuZSBWYWpow7h" <=?utf-8?b?qxjuzsbwywpow7h@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: gcj 4.2.1 entails "Un "=?UTF-8?B?QXJuZSBWYWpow7h" <=?utf-8?b?qxjuzsbwywpow7h@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000

csiph-web