File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes collation conflict Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "collation conflict" Watch "collation conflict" New topic
Author

collation conflict

newgen pras
Ranch Hand

Joined: Jun 01, 2005
Posts: 34
Hello friends ..
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]
[SQLServer]Cannot resolve collation conflict for UNION operation.
I am getting this error ... can any one help me ..

[edited subject - was "Help pls .."]
[ June 17, 2005: Message edited by: Jeanne Boyarsky ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

A "collation" in SQL Server is a definition of how character data may be sorted and compared (for example, whether case plays a part in either operation). Typically a SQL Server database is created with one collation for all tables so you can compare two fields with character datatypes no bother. But, if you try to do a join on two character fields with different collations you will run into problems since the rules for how each field in compared are different. I'd check the DDL for each table in the join - get SQL server to generate the DDL, it will include the collation definition. If they are different you should change the DDL. As a last resort you can define the collation for the join, for example:


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
newgen pras
Ranch Hand

Joined: Jun 01, 2005
Posts: 34
Thanks for ur response paul..
I guess question i posted is not more specific .. See my actual problem .. I am debugging a software .. for that thing the database should be in chineese collation ..

First time i chaged the database collation using 'ALTER' command..but the tempdb and other system thing remaind in English
collation .. so the error came ..

After that i had completly removed the database and reinstalled the database fully in chineese ...but still i am getting the error .. I don't know how to proceed ... I need suggestion about how to proceed ..
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

TEMPDB is created every time you start SQL Server, and it is created with whatever collation the model database uses. What that is is dependent on how the server instance is configured, not how you create each individual database. I can't help you with changing the collation for model - I assume its probably an install option, but I've never had to do it. Check the collation of model, and try explicitly setting it to match when you make the join.
newgen pras
Ranch Hand

Joined: Jun 01, 2005
Posts: 34
Thanks for ur help Paul....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: collation conflict