Results 1 to 4 of 4

Thread: java-mysql connection error cannot be resolved

  1. #1
    Join Date
    Feb 2011
    Location
    Bangalore, India
    Posts
    103

    Default java-mysql connection error cannot be resolved

    Hi,, due to some issues i uninstalled openjdk shipped default on my opensuse 11.3 and installed jdk 1_6_21 from a .bin file. Its installed to usr/java/jdk...... ..

    The mysql connector is also present in the same but running a java program that connects to mysql gives me the error


    java.sql.SQLException: Unknown initial character set index '192' received from server. Initial client character set can be forced via the 'characterEncoding' property.


    the code i tried is

    import java.sql.*;
    import java.io.*;

    class mysql_conn_tester
    {
    static Connection my_test_connection;
    public static void main(String args[])
    {
    try
    {
    Class.forName("com.mysql.jdbc.Driver");
    my_test_connection=DriverManager.getConnection("jdbc:mysql://localhost/test","root","");
    if(my_test_connection==null)
    System.out.println("Connection Failed\n");
    else
    System.out.println("Connection Success\n");
    }
    catch(Exception e)
    {
    System.out.println("FAILED\n"+e);
    }
    }
    }

    NB: This code has been working successfully and have tested connections before.

  2. #2
    Join Date
    Jul 2009
    Location
    Montreal, Québec
    Posts
    833

    Default Re : java-mysql connection error cannot be resolved

    Hi,

    Instead of using this bin file, did you try the package available through yast (the java-sun one) : Webpin

  3. #3
    Join Date
    Feb 2011
    Location
    Bangalore, India
    Posts
    103

    Default Re: Re : java-mysql connection error cannot be resolved

    I don't think its problem with the bin file because I've once used the same file before and things worked fine then...Just last night I have upgraded to KDE 4.5. Do you think that has something to do with this?

  4. #4
    Join Date
    Jul 2009
    Location
    Montreal, Québec
    Posts
    833

    Default Re : Re: Re : java-mysql connection error cannot be resolved

    Quote Originally Posted by melvinjose View Post
    I don't think its problem with the bin file because I've once used the same file before and things worked fine then...Just last night I have upgraded to KDE 4.5. Do you think that has something to do with this?
    I really doubt it.... Make sure all the packages with openjdk are uninstalled on your system.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •