Learn how to a build a cloud-first strategyRegister Now


Java Hibernate Error: Unsupported VM encoding MS936.

Posted on 2009-02-08
Medium Priority
Last Modified: 2013-12-15
Hi, I have a class called TestDAO (see code below), and the following is the output:

allGames.length: 20
allMatches.length: 59

When I modified TestDAO's main method to the following:

            JjCompetitionDAO jjCompetitionDAO = new JjCompetitionDAO();
            Object[] allCompetitions = jjCompetitionDAO.findAll().toArray();
            System.out.println("allCompetitions.length: " + allCompetitions.length);

I get the following error:

Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute query
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at org.hibernate.loader.Loader.doList(Loader.java:2148)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
      at org.hibernate.loader.Loader.list(Loader.java:2024)
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
      at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
      at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)
      at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      at com.JjCompetitionDAO.findAll(JjCompetitionDAO.java:96)
      at com.TestDAO.main(TestDAO.java:8)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported VM encoding MS936.
      at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
      at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
      at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
      at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
      at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
      at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
      at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
      at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
      at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
      at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
      at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
      at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
      at org.hibernate.loader.Loader.doQuery(Loader.java:662)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
      at org.hibernate.loader.Loader.doList(Loader.java:2145)
      ... 9 more


Does anybody know why this error occurs and how to fix it? I've googled it but found a lot of sites in Chinese.
package com;
public class TestDAO {
	public static void main(String[] args)
		JjCompetitionGameDAO jjCompetitionGameDAO = new JjCompetitionGameDAO();
		Object[] allGames = jjCompetitionGameDAO.findAll().toArray();
		System.out.println("allGames.length: " + allGames.length);
		JjCompetitionGameMatchDAO jjCompetitionGameMatchDAO = new JjCompetitionGameMatchDAO();
		Object[] allMatches = jjCompetitionGameMatchDAO.findAll().toArray();
		System.out.println("allMatches.length: " + allMatches.length);

Open in new window

Question by:killdurst
  • 3
  • 2
  • 2
LVL 86

Expert Comment

ID: 23587906
You need to ensure you have full multilingual support installed. See

LVL 92

Expert Comment

ID: 23587955
First make sure you aren't using an english only version of the java vm.
Then check the encoding used in the connection string is supported by the vm you have installed.


Author Comment

ID: 23588005
Before I go and re-download and re-install the jdk again, how do I check what is the language of my current JDK? Thanks.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 86

Accepted Solution

CEHJ earned 750 total points
ID: 23588016
There's no such thing as the 'language' of the JDK. It's a question of whether you installed full multilingual support or not. If you still have the installer for the present one, you might be able to use that
LVL 92

Assisted Solution

objects earned 750 total points
ID: 23588030
you don't need to redownload (just reinstall), the installer includes everything. Just make sure when you install that you that you include the support you require.

Author Comment

ID: 23588593
Hi guys, I was just checking the build path of my project and I found out that it was pointing to the workspace default, which was jre1.5.0_06. I changed it to point to my jdk1.6.0_03 and it's working fine now. Not getting the error message anymore! :)
LVL 86

Expert Comment

ID: 23588610

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month20 days, 17 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question