<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
<flow name="worldfiletestFlow1" doc:name="worldfiletestFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
<logger message="==========started=========" level="INFO" doc:name="Logger"/>
<scripting:component doc:name="Python">
<scripting:script engine="jython" >from java.lang import Class
Class.forName("org.hsqldb.jdbc.JDBCDriver");
from java.sql import Statement, ResultSet, DriverManager
connection = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost","sa","")
statement = connection.createStatement()
resultSet = statement.executeQuery("select * from test");
while resultSet.next():
print "%s (%s)" % (resultSet.getString("name"), resultSet.getString("personId"))
resultSet.close();
statement.close();
connection.close();
</scripting:script>
</scripting:component>
<logger message="=========END==========" level="INFO" doc:name="Logger"/>
</flow>
</mule>
1) When I run only Jython script, data from db is displaying in the console. This will run only when there is hsqldb.jar is added to the pydev-PYTHONPATH->EXTERNAL LIBRARIES-> add jar files. If I don't add here, it doesnt run, it says ClassNotFoundException org.hsqldb.jdbc.JDBCDriver.
2) When I run from Mule it says ClassNotFoundException: org.hsqldb.jdbc.JDBCDriver
I have added hsqldb.jar in mule studio->project->properties->build path->libraries->add external libraries.
error msg:
java.lang.ClassNotFoundException: java.lang.ClassNotFoundException: org.hsqldb.jdbc.JDBCDriver
at org.python.core.Py.JavaError(Unknown Source)
at org.python.core.Py.JavaError(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(Unknown Source)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
I am using hsqldb2.3.2.jar.