Open kalaiyarasiganeshalingam opened 1 year ago
Tested the JDBC Connector with a free trial InterBase Server(InterBase Server Edition 2020). The following problems arose during this test. Fixed some issues with it.
Couldn't find the latest interclient.jar
for testing.
The Maven repo has this jar, but this is not working. So, I got the JAR from this site.
Fixed the above error by setting the interbase.interclient.Driver
. After that, the following error returned:
java.lang.NoClassDefFoundError: sun/io/ByteToCharConverter
Checked the existing implementation by configuring the data source:
Added InterBase.interclient.DataSource
as a data source. (https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.InterBaseAndJavaMakingTheConnection)
Client initialisation:
jdbc:Client _ = check new (url ="jdbc:interbase://localhost:3050//opt/interbase/examples/employee.gdb", user ="SYSDBA", password = "masterkey", options = {datasourceName :"interbase.interclient.DataSource"});
Error:
error: Error in SQL connector configuration: Property url does not exist on target class interbase.interclient.DataSource
Fixed this issue by removing the URL property from the Hikari config. After that, tested the scenario with the following client initialization:
jdbc:Client jdbcClient = check new (url ="jdbc:interbase://localhost:3050//opt/interbase/examples/employee.gdb", user ="SYSDBA", password = "masterkey", options = {datasourceName :"interbase.interclient.DataSource", properties: {networkProtocol: "jdbc:interbase:", databaseName: "/opt/interbase/examples/employee.gdb"}});
Error:
java.lang.NoClassDefFoundError: sun/io/ByteToCharConverter
Used interbase.interclient.JdbcConnectionFactory
as a data source (https://docwiki.embarcadero.com/InterBase/2020/en/InterClient_Connection_Pooling)
Client initialisation:
jdbc:Client _ = check new (url ="jdbc:interbase://localhost:3050//opt/interbase/examples/employee.gdb", user ="SYSDBA", password = "masterkey", options = {datasourceName :"interbase.interclient.JdbcConnectionFactory"});
Error:
java.lang.ClassNotFoundException: interbase.interclient.JdbcConnectionFactory
Conclusion of this testing:
sun/io/ByteToCharConverter
class was deprecated in java 7. and this testing jar is not the latest jar. So, getting this error with java11. java.lang.NoClassDefFoundError: sun/io/ByteToCharConverter
interbase.interclient.JdbcConnectionFactory
class name gets from the latest doc. Hence, the oldest jar may not have this class.
Description: Getting the following error when trying to connect with the
interbase
database by usinginterclient.jar
Run the following code by adding driver jar in the Ballerina.toml to reproduce this error: