I am trying to save data from my XPage to MySQL database. I have established a connection and it works (which is demonstrated by the fact that my dynamic view panel is able to fetch data in MySQL tables). But I am unable to submit my data to MySQL. I am following the example database ofXPagesJDBC.nsf
in extension library.
MySQL connection file mysqlconn.jdbc
:
com.mysql.jdbc.Driver
jdbc:mysql://***.***.***.***:3306/project_management
adminuser
******
In my XPage I create a data source with xe:jdbcRowSet
Then in my xp:panel
I use the data source to save the object. I have two fields of name and description mapped to respective columns in tables in MySQL database.
Name
Description
When I try to click on Save button data is not saved and no error is shown. But if I change the Button type
to Submit
(
) it gives me error:
Error saving data source jdbcrsProjectMgmt
javax.sql.rowset.spi.SyncProviderException: Can't call commit when autocommit=true
Can't call commit when autocommit=true
But this time strangely the data gets saved. I can't find this autocommit
property and don't know where to set it. How can I solve this? Is this issue with XPages or MySQL?