MySQL JDBC驱动连接字符串?

时间:2013-02-14 21:18:18

标签: mysql jdbc cobol

如何使用JDBC驱动程序连接MySQL数据库? 对于Cobol,使用Percobol软件。

    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
    .

怎么了?

来源: 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

1 个答案:

答案 0 :(得分:1)

找到解决方案:

    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
    .