Connecting to a Windows database from Z/OS
Posted by: D Hughes
Date: January 27, 2022 03:44PM

I am trying to connect to a MySQL database running on a Windows server from a Java application running on IBM's Z/OS. I get the following error:

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check th
e manual that corresponds to your MySQL server version for the right syntax to u
se near 'a\@?????`?????????`????`?K?K??@M???????z@??????????????????????????????
???????]' at line 1

The same Java application runs correctly when executed on a Windows machine.

I am guessing that the issue is the different character sets ( EBCIDIC, ASCII ). I do get connected, so the username, and database are getting thru correctly, but perhaps those are transmitted differently.

Any help would be appreciated.

Here are the first couple of log entries from a working Windows connection:

2022-01-27T21:29:36.202995Z 31 Query /* mysql-connector-java-8.0.27 (Revision: e920b979015ae7117d60d72bcc8f077a839cd791) */SELECT @@session.auto_increment_increment AS auto_increment_increment, @@character_set_client AS character_set_client, @@character_set_connection AS character_set_connection, @@character_set_results AS character_set_results, @@character_set_server AS character_set_server, @@collation_server AS collation_server, @@collation_connection AS collation_connection, @@init_connect AS init_connect, @@interactive_timeout AS interactive_timeout, @@license AS license, @@lower_case_table_names AS lower_case_table_names, @@max_allowed_packet AS max_allowed_packet, @@net_write_timeout AS net_write_timeout, @@performance_schema AS performance_schema, @@sql_mode AS sql_mode, @@system_time_zone AS system_time_zone, @@time_zone AS time_zone, @@transaction_isolation AS transaction_isolation, @@wait_timeout AS wait_timeout
2022-01-27T21:29:36.307588Z 31 Query SET character_set_results = NULL

Options: ReplyQuote

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.