Worklight Adapter to connect to Advantage Database

让人想犯罪 __ 提交于 2019-12-25 17:05:28

问题


I need to connect to the Advantage Database through worklight Adapter. I added the adsjdbc.jar(8.1), and added the datasource definition in *SQLadapter.xml file

<dataSourceDefinition>
<driverClass>com.extendedsystems.jdbc.advantage.ADSDriver</driverClass>
<url>jdbc:extendedsystems:advantage://ipaddress:port/wxzy$/TP8/COMPANY/ABCDMAIN/ABCDMAIN.add;</url>
<user>xyz</user>
<password>12345</password>
</dataSourceDefinition>

When I try to Invoke the procedure, It throws

{
"errors": [
 "Runtime: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Extended Systems][Advantage JDBC]Connection reset)"
],
"info": [
 ],
"isSuccessful": false,
"warnings": [
]
}

Kindly advice.

Thanks

Thanks @Idan, I tried with a Java Program to connect, before trying with the adapter as below,

Class.forName("com.extendedsystems.jdbc.advantage.ADSDriver");

connection = DriverManager.getConnection("jdbc:extendedsystems:" +
        "advantage://port:host//abcd$//TP8//COMPANY//XYZMAIN//XYZMAIN.add;user=xxxx;password=123456");
 statement = connection.createStatement();
resultSet = statement.executeQuery("select * from USERS");
while (resultSet.next()) {
 System.out.println("PS USER NAME :"+ resultSet.getInt("PS_USERNAME"));
}

But I get a com.extendedsystems.jdbc.advantage.ADSException: [Extended Systems][Advantage JDBC]Connection reset

Please Advice.

Thanks


回答1:


I suspect that problem is in the JDBC URL value.

You have set the following: <url>jdbc:extendedsystems:advantage://ipaddress:port/wxzy$/TP8/COMPANY/ABCDMAIN/ABCDMAIN.add;</url>

But in the documentation it gives this example: ("jdbc:extendedsystems:advantage://server1:6262/test/data;user=user1;password=up1");

So if I were you I'd check why you used the JBDC URL that you've used there, which does not seem to be inline with the product doucmentation of Advantage Database.



来源:https://stackoverflow.com/questions/35596528/worklight-adapter-to-connect-to-advantage-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!