Topic
7 replies Latest Post - ‏2013-01-28T10:03:22Z by IdanAdar
SystemAdmin
SystemAdmin
2327 Posts
ACCEPTED ANSWER

Pinned topic how to connect mysql(xampp) to worklight project?

‏2013-01-28T03:57:10Z |
Hi, I'm new in worklight. Please help me connect database!
I used Module 5.1 - Creating SQL Adapters, but it's not Ok.
Please help me! Thank all!
  • SystemAdmin
    SystemAdmin
    2327 Posts
    ACCEPTED ANSWER

    Re: how to connect mysql(xampp) to worklight project?

    ‏2013-01-28T04:16:27Z  in response to SystemAdmin
    And this my Invocation Result

    {
    "errors": [
    "Runtime: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'quynhnga'@'localhost' (using password: YES))"
    ],
    "info": [
    ],
    "isSuccessful": false,
    "warnings": [
    ]
    }
  • SystemAdmin
    SystemAdmin
    2327 Posts
    ACCEPTED ANSWER

    Re: how to connect mysql(xampp) to worklight project?

    ‏2013-01-28T04:25:24Z  in response to SystemAdmin
    i deleted user and password and invocation result is
    "Runtime: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'"
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: how to connect mysql(xampp) to worklight project?

    ‏2013-01-28T05:27:53Z  in response to SystemAdmin
    Hi,

    In your second post you mention a user "quynhnga". Does this user exist in your MySQL Server? Have you given it permissions to access the Worklight database? Did you define this user in the adapter XML?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    • SystemAdmin
      SystemAdmin
      2327 Posts
      ACCEPTED ANSWER

      Re: how to connect mysql(xampp) to worklight project?

      ‏2013-01-28T06:39:55Z  in response to IdanAdar
      Thanks for your help.
      I changed my password to "root". But after, it appear this message:

      {
      "errors": [
      "Runtime: Type 'Function' currently does not support marshalling to JSON."
      ],
      "info": [
      ],
      "isSuccessful": false,
      "warnings": [
      ]
      }
      • SystemAdmin
        SystemAdmin
        2327 Posts
        ACCEPTED ANSWER

        Re: how to connect mysql(xampp) to worklight project?

        ‏2013-01-28T07:27:45Z  in response to SystemAdmin
        And this error

        {
        "errors": [
        "Illegal Argument: invalid type of element"
        ],
        "info": [
        ],
        "isSuccessful": false,
        "warnings": [
        ]
        }
        • SystemAdmin
          SystemAdmin
          2327 Posts
          ACCEPTED ANSWER

          Re: how to connect mysql(xampp) to worklight project?

          ‏2013-01-28T07:50:46Z  in response to SystemAdmin
          This is my connect-impl.js
          var procedure1Statement = WL.Server.createSQLStatement("select * from GUARD where ID = ?");
          function procedure1(param) {
          return WL.Server.invokeSQLStoredProcedure({
          procedure : "procedure1ByID",
          parameters : param
          });
          }
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: how to connect mysql(xampp) to worklight project?

    ‏2013-01-28T10:03:22Z  in response to SystemAdmin
    Solution provided here: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=469341

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform