0
votes

I'm pretty new to WSO2 SP, and trying to read data from a SQL Server DB using the tutorial here. But unfortunately, I'm not able to make a connection to the SQL Server database, to move further.

I've placed the latest JDBC driver in lib folder.

@App:name('MyTestApp')

@source(type = 'http', @map(type = 'json'))
define stream RawMaterialStream(name string, username string, empid string);

@primaryKey('empid')
@index('name')
@store(type='rdbms', jdbc.url="jdbc:sqlserver://<servername>:1433;databaseName=ACL", username="<username>", password="<password>",jdbc.driver.name="com.microsoft.sqlserver.jdbc.SQLServerDriver")
define table EmpDetails(name string, username string, empid string);

from RawMaterialStream
select name, username, empid
update or insert into EmpDetails
on EmpDetails.name == name;

These are the errors received during execution:

[2019-03-20_20-19-56_912] ERROR {com.zaxxer.hikari.util.PropertyElf} - Exception setting property driverClassName on target class com.zaxxer.hikari.HikariConfig

java.lang.reflect.InvocationTargetException

[2019-03-20_20-19-56_913] ERROR {org.wso2.siddhi.core.table.Table} - Error on 'MyTestApp'. java.lang.reflect.InvocationTargetException . Error while connecting to Table 'EmpDetails'. (Encoded)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

Can anyone please help/advice?

1

1 Answers

1
votes

It seems the MSSQL JDBC driver is not OSGified. As drivers need to be OSGified to be recognised by SP.

You can convert to OSGi bundle using the following command in /bin

./jartobundle.sh ../lib

Please see following doc for more details.