Skip to main content

alphaWorks  >  Forums  >  IBM JZOS Batch Toolkit for z/OS SDKs  >  developerWorks

JZOS/ZLINUX - encoding problems?    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is answered.

Permlink Replies: 2 - Pages: 1 - Last Post: Sep 22, 2009 1:31 PM Last Post By: arsi Threads: [ Previous | Next ]
arsi

Posts: 14
Registered: Aug 12, 2009 12:34:08 PM
JZOS/ZLINUX - encoding problems?
Posted: Sep 17, 2009 11:25:19 AM
 
Click to report abuse...   Click to reply to this thread Reply
Hello,

Please direct me to the proper forum if this is not the one.

I am trying to connect to MYSQL on ZLINUZ from JZOS. Connection works fine from my workstation but not from ZOS. I have granted all previleges to the user but is not working. I was wondering if this is related some type of encoding problems.

Please advice
Ulises

ZLINUX mysql database user:

mysql> select host,user from user where user='ual';
+-----------------------+------+

host user

+-----------------------+------+
ibmtst.metro-dade.com ual

+-----------------------+------+

Exception follows:

SQL-EXC java.sql.SQLException: Access denied for user: 'ual@ibmtst.metro-dade.com' (Using password: YES)
!! END OF JES SPOOL FILE !!
java.sql.SQLException: Access denied for user: 'ual@ibmtst.metro-dade.com' (Using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1235)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)
at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:562)
at java.sql.DriverManager.getConnection(DriverManager.java:155)
at com.ual.jzos.LoadDB.connect(LoadDB.java:29)
at com.ual.jzos.LoadDB.main(LoadDB.java:16)
!! END OF JES SPOOL FILE !!
KirkWolf

Posts: 195
Registered: Jan 17, 2006 03:13:58 PM
Re: JZOS/ZLINUX - encoding problems?
Posted: Sep 17, 2009 04:11:42 PM   in response to: arsi in response to: arsi's post
 
Click to report abuse...   Click to reply to this thread Reply
This is not really an issue with JZOS, but is a common problem with running Java code on z/OS.

The problem is likely that the MySQL JDBC driver is expecting that the default file encoding of the JVM is "ASCII". This is a bug IMO, since Java JVMs can use a non-ASCII default file encoding, but it is not an uncommon assumption. It should be explicitly setting the encoding when it communications over TCP/IP to the MYSQL server, rather than relying on a default. Check the documentation for the MySQL driver - perhaps there is a setting that will allow you to specify the connection encoding rather than use the file.encoding system property.

If not, the only workaround may be to run the z/OS Java JVM with an ASCII default file encoding (-Dfile.encoding=ISO8859-1). This will have the side effect of causing all of your file I/O to default to ASCII encoding, but you can usually work around this by specifying the encoding that you want when you read HFS/zFS files or z/OS datasets.
arsi

Posts: 14
Registered: Aug 12, 2009 12:34:08 PM
Re: JZOS/ZLINUX - encoding problems?
Posted: Sep 22, 2009 01:31:35 PM   in response to: KirkWolf in response to: KirkWolf's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks!
Adding this encoding -Dfile.encoding=ISO8859-1 resolved the problem.

Thanks for your support.
Ulises

Point your RSS reader here for a feed of the latest messages in all forums