wood burning stoves 2.0*
The moose likes JDBC and the fly likes Mysql driver fails on connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Mysql driver fails on connection" Watch "Mysql driver fails on connection" New topic
Author

Mysql driver fails on connection

Adithya NN
Greenhorn

Joined: May 14, 2008
Posts: 6
Hi,
I am using the following piece of code for establishing the connectivity



However i am getting the following exception when i run the program

I tried to print the SQL error code and it comes to be 0.
I am not using any query or anything this exception occurs when i call Drivermanager.getCnnection().

Can any one help me and tell me where i am going wrong
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18110
    
    8

"Adithya Neurons", please check your private messages for an important administrative matter.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
Originally posted by Paul Clapham:
"Adithya Neurons", please check your private messages for an important administrative matter.
I am afraid you will have to check your private messages again, Adithya.
Adithya NN
Greenhorn

Joined: May 14, 2008
Posts: 6
Hi
We generally dont use our last name in india since its most of the time our fathers name So i wud still be preffered to call Adithya NN. If it still violates your naming policy I am afraid i will have to leave JavaRanch.I dint expect this kind of insensitivity from your end

Thanks & regards
Adithya N N
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3216
Look at


http://www.coderanch.com/t/307219/JDBC/java/Connecting-MySQL
[ August 15, 2008: Message edited by: arulk pillai ]

Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
Adithya NN
Greenhorn

Joined: May 14, 2008
Posts: 6
I have added the connector jar downloaded into the class path and have also tried using the code present in the above link none of them work.I keep getting the Exception. Its not the ClassNotFoundException its some other kind of exception as i have posted above
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3216
28.4.5.3.9: When using gcj an java.io.CharConversionException is raised when working with certain character sequences.

This is a known issue with gcj which raises an exception when it reaches an unknown character or one it cannot convert. You should add useJvmCharsetConverters=true


http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-troubleshooting.html#qandaitem-28-4-5-3-9


Google for - MySQL Caused by: java.io.CharConversionException
Adithya NN
Greenhorn

Joined: May 14, 2008
Posts: 6
Thanks it worked.I changed the JRE to Sun. And the it worked with gcj upon passing the VM argument
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
It's not a case of insensitivity, but of bitter experience with fora where people use pseudonyms only. The atmosphere can become unpleasant and we have found that enforcing the naming policy strictly helps maintain a friendly atmosphere here, even though (and we are sorry about that) it may inconvenience a few people.

It would not be appropriate to continue discussing the naming policy here, but you are welcome to go through the "Javaranch" forum where that sort of thing is normally discussed.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
And well done getting your problem sorted out
[ August 15, 2008: Message edited by: Campbell Ritchie ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
As to the display name, note that you're free to choose any name you like. It doesn't have to be your real name, it just has to sound like a real name, and have a full first and last name.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mysql driver fails on connection
 
Similar Threads
mysql..connectivity
Function does not Exist
No operations allowed after statement closed.
mysql connection using eclipse (ubuntu)
SQLException: Data truncated