Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    I have a problem connect for mysql database (i want know that how to setting server.properties)

    Test by Java - success
    =======================
    Class.forName("com.mysql.cj.jdbc.Driver");
    DriverManager.getConnection("jdbc:mysql://{hostname}.co.kr:3306/{dbname}?characterEncoding=UTF-8&serverTimezone=UTC", "test", "test1234");

    If you test with the above method, successful connect db & select data



    Test by smartclient - fail
    ======================

    server.properties
    -------------------------------------
    sql.mysqltest.database.type: mysql
    #sql.mysqltest.database.ansiMode: false
    sql.mysqltest.driver.networkProtocol: tcp
    sql.mysqltest.interface.credentialsInURL: true
    sql.mysqltest.interface.type: driverManager
    sql.mysqltest.pool.enabled: false
    sql.mysqltest.autoJoinTransactions: false
    sql.mysqltest.default.sequence.mode: jdbcDriver

    sql.mysqltest.driver: com.mysql.cj.jdbc.Driver
    sql.mysqltest.driver.driverName: mysql
    sql.mysqltest.driver.serverName: {hostname}.co.kr
    sql.mysqltest.driver.portNumber: 3306
    sql.mysqltest.driver.databaseName: {dbname}
    sql.mysqltest.driver.user: test
    sql.mysqltest.driver.password: test1234


    test_tb.ds.xml
    ---------------------------------------
    <DataSource
    serverType="sql"
    dbName="mysqltest"
    ID="test_tb"
    tableName="test_tb"
    >
    <fields>
    <field name="tt_a" type="sequence" primaryKey="true" implicitSequence="true"></field>
    <field name="tt_b" type="ntext" length="1000" required="true"></field>
    </fields>

    <operationBindings>
    <operationBinding operationType="fetch">
    <orderClause>tt_a</orderClause>
    </operationBinding>
    </operationBindings>

    </DataSource>


    ERROR >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    java.sql.SQLException: Access denied for user 'test'@'xxx.xxx.xxx.xxx' (using password: YES)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)
    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:270)
    at com.isomorphic.sql.SQLDriver.rawConnection(SQLDriver.java:817)
    at com.isomorphic.sql.PoolableSQLConnectionFactory.makeUnpooledObject(PoolableSQLConnectionFactory.java:129)
    at com.isomorphic.sql.PoolableSQLConnectionFactory.makeObject(PoolableSQLConnectionFactory.java:138)
    at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:104)
    at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:76)
    at com.isomorphic.sql.SQLConnectionManager.getConnection(SQLConnectionManager.java:177)
    at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:951)
    at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:919)
    at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:912)
    at com.isomorphic.sql.SQLDriver.getScalarResult(SQLDriver.java:1105)
    at com.isomorphic.sql.SQLDriver.executeScalar(SQLDriver.java:1399)
    at com.isomorphic.sql.SQLDataSource.runRowCountQuery(SQLDataSource.java:2956)
    at com.isomorphic.sql.SQLDataSource.executeWindowedSelect(SQLDataSource.java:2332)
    at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1755)
    at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:439)
    at com.isomorphic.sql.SQLDataSource.executeFetch(SQLDataSource.java:384)
    at com.isomorphic.datasource.DataSource.execute(DataSource.java:2228)
    at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:629)
    at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:546)
    at com.isomorphic.application.AppBase.execute(AppBase.java:489)
    at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2813)
    at org.apache.jsp.tools.developerConsoleOperations_jsp._jspService(developerConsoleOperations_jsp.java:183)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
    at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:93)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)




    how can i do ?




    #2
    You've got credentialsInURL true but the credentials are not in the URL in your separate Java test.

    Note you probably do not want to be set autoJoinTransactions and pool.enabled to false.

    Comment


      #3
      Note that if the above doesn't fix it, you try specifying the full URL directly (just to eliminate any typos you may have introduced). You should also verify you are doing the connection from the same machine as your standard Java test, as the connection does seem to be initiated, but MySQL is rejecting your credentials.

      Comment

      Working...
      X