简体   繁体   English

MySQL JDBC驱动程序连接字符串?

[英]MySQL JDBC driver connection string?

How do I connect to a MySQL Database with the JDBC Driver? 如何使用JDBC驱动程序连接到MySQL数据库? This for Cobol, using Percobol software. 使用Percobol软件,用于Cobol。

    DO-CONNECT.
     STRING "jdbc:mysql://gpiw.be/db;"
      DELIMITED BY SIZE
      "user=user_db;"
      DELIMITED BY SIZE
      "password=*********"
      DELIMITED BY SIZE
      INTO JdbcString
     EXEC SQL
      CONNECT
       TO :JdbcString
       DRIVER "com.mysql.jdbc.Driver"
     END-EXEC
    .

What's wrong? 怎么了?

Sources: http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html http://www.easysoft.com/developer/interfaces/odbc/sqlstate_status_return_codes.html#28000 资料来源: http : //dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html http://www.easysoft.com/developer/interfaces/odbc/sqlstate_status_return_codes.html #28000

Found the solution: 找到了解决方案:

    DO-CONNECT.
     STRING "jdbc:mysql://***ip****/***database**?"
      DELIMITED BY SIZE
      "user=****username****&"
      DELIMITED BY SIZE
      "password=****password******"
      DELIMITED BY SIZE
      INTO JdbcString
     EXEC SQL
      CONNECT
       TO :JdbcString
       DRIVER "com.mysql.jdbc.Driver"
     END-EXEC
    .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM