Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

java.sql.SQLException beim Verbindungsaufbau

Empfohlene Antworten

Veröffentlicht

Hi ich habe ein kleines Problem beim Herstellen einer Verbindung zu meiner MySQL-Datenbank. Der DB-Server läuft auf Debian 4.04, die Anwendung eigentlich auf Windows Vista. Dabei habe ich auch keine Probleme - also kann ich mir eigentlich sicher sein, dass ich die richtigen Dinge tue.

Wenn ich die Anwendung allerdings auch auf Debian ausführen möchte, wird eine Exception geworfen.


java.sql.SQLException: Error during query: Unexpected Exception: java.io.CharConversionException message given: null


Nested Stack Trace:



** BEGIN NESTED EXCEPTION ** 


java.io.CharConversionException


STACKTRACE:


java.io.CharConversionException

   at gnu.gcj.convert.Input_iconv.read(libgcj.so.70)

   at java.lang.String.init(libgcj.so.70)

   at java.lang.String.<init>(libgcj.so.70)

   at com.mysql.jdbc.SingleByteCharsetConverter.<init>(SingleByteCharsetConverter.java:153)

   at com.mysql.jdbc.SingleByteCharsetConverter.initCharset(SingleByteCharsetConverter.java:108)

   at com.mysql.jdbc.SingleByteCharsetConverter.getInstance(SingleByteCharsetConverter.java:86)

   at com.mysql.jdbc.Connection.getCharsetConverter(Connection.java:3478)

   at com.mysql.jdbc.StringUtils.getBytes(StringUtils.java:615)

   at com.mysql.jdbc.Buffer.writeStringNoNull(Buffer.java:655)

   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1686)

   at com.mysql.jdbc.Connection.execSQL(Connection.java:3250)

   at com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java:2514)

   at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:4112)

   at com.mysql.jdbc.Connection.createNewIO(Connection.java:2762)

   at com.mysql.jdbc.Connection.<init>(Connection.java:1553)

   at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)

   at java.sql.DriverManager.getConnection(libgcj.so.70)

   at java.sql.DriverManager.getConnection(libgcj.so.70)

   at film.FilmDb.getConnection(FilmDb.java:468)

   at test.Program.<init>(Program.java:19)

   at test.Program.main(Program.java:26)



** END NESTED EXCEPTION **



   at com.mysql.jdbc.Connection.execSQL(Connection.java:3303)

   at com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java:2514)

   at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:4112)

   at com.mysql.jdbc.Connection.createNewIO(Connection.java:2762)

   at com.mysql.jdbc.Connection.<init>(Connection.java:1553)

   at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)

   at java.sql.DriverManager.getConnection(libgcj.so.70)

   at java.sql.DriverManager.getConnection(libgcj.so.70)

   at film.FilmDb.getConnection(FilmDb.java:468)

   at test.Program.<init>(Program.java:19)

   at test.Program.main(Program.java:26)

Bis zur Methode FilmDb.getConnection, die im Stacktrace zu finden ist, handelt es sich um meinen Code. In der Methode erstellen ich den ConnectionString und versuche meine Verbindung zu öffnen. Hier scheint es irgendwo zu Konvertierungsproblemen zu kommen. Weiß jemand, wie ich die beheben kann?

Du solltest Java-Anwendungen aus Kompatibilitätsgründen grundsätzlich mit der JRE von Sun ausführen, das erspart Dir diverse Probleme.

In diesem Fall nutzt dem Stacktrace nach zu urteilen GJC.

Installiere die passende Java Runtime Environment von Sun (1.4.2, 1.5.0 oder 1.6.0) und führe Dein Projekte damit aus, dann sollte der Fehler nicht mehr auftreten.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.