Hi Experts,
I am new to Oracle MAF 2.2, I am using Rest/JSON with AMPA. I want to Update a specific record IN SQLite database from Java Bean.
For that i started with Insert Statement from JAVA bean but its throwing error.
My code goes like below,
public void testInsert(ActionEvent actionEvent) throws SQLException {
// Add event code here...
String docRoot = AdfmfJavaUtilities.getDirectoryPathRoot(AdfmfJavaUtilities.ApplicationDirectory);
String dbName = docRoot + "/mb_cart_v9.db";
Connection conn = new SQLite.JDBCDataSource("jdbc:sqlite:" + dbName).getConnection();
conn.setAutoCommit(false);
PreparedStatement stmt = conn.prepareStatement("insert into OM_ITEM_PRICE_LIST (PLI_ITEM_CODE, PLI_RATE) values (?,?);");
throw new AdfException(dbName, AdfException.INFO);
stmt.setString(1, "TEST");
stmt.setString(2, "2000");
stmt.executeUpdate();
conn.commit();
}
Please help.
Thanks & Regards,
Bharat