Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7579795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:45:34+00:00 2026-05-30T17:45:34+00:00

I am implementing a class that needs to connect to a MYSQL database….on a

  • 0

I am implementing a class that needs to connect to a MYSQL database….on a windows system, i had some connection issue which were resolved with changing the “bind-address” paramater in the MYSQL configuration file to localhost and setting the MYSQL connector in the classpath.
I tried the same steps on Red Hat Linux,..but no connection is made. Is it something with the security configuration?. Below is the code i am using to test for a MYSQL connection.

import java.sql.*;
public class test {
    static Connection con = null;

    public static void main(String[]args) throws SQLException,ClassNotFoundException {

        //Load Driver

        try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();               
            con = DriverManager.getConnection("jdbc:mysql://localhost/IMS","root","root1");
            System.out.println("Database Connected");
        } catch(Exception e) {
            System.err.println("error connecting database: little challenge" + e);
            System.exit(2);
        }
    }
}

The error being returned is

error connecting database: 
    little challenge java.sql.SQLException:
    Unexpected exception encountered during query.

I believe this means the connection is not being made. How can i resolve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:45:35+00:00Added an answer on May 30, 2026 at 5:45 pm

    Looks like a problem related to use of GCJ. It relates to the connection attempt raising an exception when it reaches an unknown character or one it cannot convert.

    Recommendation: use Hotspot (a.k.a. Sun) JVM.

    Update: To do so, install the JDK rpm and use alternatives command to set the default JVM version as shown on superuser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't find any documentation on implementing a class that inherits System.Windows.Media.Brush - what
I am implementing a my custom class which needs to be derived from Panel.
I'm implementing a class that wraps around an xml document with a very strictly
Fixed: See notes at bottom I am implementing a generic class that supports two
I have a factory class that populates objects with data. I want to implementing
I'm implementing a cache in a class library that i'm using in an asp.net
I'm writing a class interface that needs to return references to binary files. Typically
I'm implementing a class that talks to a motor controller over a USB device.
I am working on implementing use of the mysql class found here in an
If I have a class that needs to implement an interface but one or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.