[Fwd: Re: Verify character encoding of database]

[Fwd: Re: Verify character encoding of database]

 

  

Sorry, the code snippet is incorrect...
This is how it really is:

--8<--------------------------------------
stmt = connection.prepareStatement("get db cfg for testdb");
result = stmt.executeQuery();

while (result.next())
{
System.out.println(result.getString(1));
}
--8<--------------------------------------

Johannes




-------- Original Message --------
Subject: Re: Verify character encoding of database
Date: Mon, 25 Oct 2004 14:38:49 +0200
From: SlowJoe <db2udbdba-ezmlmshield-x10080440.[Email address protected]
To: LazyDBA Discussion <[Email address protected]

Hi Gary,

thanks for your suggestion.
I knew this command. Unfortunately, it does not help me in my case,
because I need to access the configuration information from within a
Java application.
This statement is not recognized as a valid SQL statement by the CLI.
This is a snippet of my code:
--8<--------------------------------------
stmt = connection.prepareStatement();
result = stmt.executeQuery();

while (result.next())
{
System.out.println(result.getString(1));
}
--8<--------------------------------------

And this is the exception I receive in return:

------------------------------------------
COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0637E QUERY cannot
be found.
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throwInvalidQueryError(Unknown
Source)
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery(Unknown Source)
at
com.ibm.wps.datastore.dbinsight.DatabaseInsight.checkCharacterEncodingForDB2Multiplatform(DatabaseInsight.java:392)
at
com.ibm.wps.datastore.dbinsight.DatabaseInsight.checkCharacterEncoding(DatabaseInsight.java:371)
at
com.ibm.wps.datastore.dbinsight.DatabaseInsight.checkAndLog(DatabaseInsight.java:552)
at
com.ibm.wps.datastore.dbinsight.DatabaseInsight.main(DatabaseInsight.java:639)
------------------------------------------

What I need is a table or catalog view that gives me the character
encoding information.
Any idea?

Regards,

Johannes





Gary Hempstead wrote:
> **A LazyDBA.com subscriber has responded to your lazydba.com post**
> **LazyDBA.com mail shield has forwarded you this email,
> **and removed any attachments, and kept your email address secret
> **from this person, and any viruses/trojans.
> **If you reply to this email, the person will see your email address as normal
> **Anything below this line is the original email text
>
>
> 'get db cfg for database'
>
> Then look at the codepage/codeset.
>
> Rgds.
>
> -----Original Message-----
> From: SlowJoe
> [mailto:db2udbdba-ezmlmshield-x5362632.[Email address protected]
> Sent: 25 October 2004 11:02
> To: LazyDBA Discussion
> Subject: Verify character encoding of database
>
> Hi there,
>
> I need to connect to a DB2 database, which is required to be UNICODE
> enabled. Usually, it is created like this:
>
> db2 CREATE DATABASE testdb USING CODESET UTF-8 TERRITORY us
>
> Unfortunately, it is not me, who creates the database. I have to rely on
>
> the database admins to create it correctly.
>
> Now, I would like to verify the database settings. Is there another way
> than putting UNICODE encoded strings into a test table and query them
> afterwards to see, whether the strings are still the same?
>
> I looked through the SQL Reference Appendix D, where the catalog views
> are described... I did not find any related view.
>
> JDBC database metadata does not give me any evidence either.
>
> If you can give me an advice, I would greatly appreciate it.
>
> Thanks,
>
> Johannes
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>
> ************************************************************************
>
> If you have received this e-mail in error, please delete it and notify the sender as soon as possible. The contents of this e-mail may be confidential and the unauthorized use, copying, or dissemination of it and any attachments to it, is prohibited.
>
> Internet communications are not secure and Hyperion does not, therefore, accept legal responsibility for the contents of this message nor for any damage caused by viruses. The views expressed here do not necessarily represent those of Hyperion.
>
> For more information about Hyperion, please visit our Web site at www.hyperion.com
>
>
>


---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



DB2 & UDB email list listserv db2-l LazyDBA home page