import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class TestMariaDbUpdateView {
    /* test table schema:
      CREATE OR REPLACE TABLE `ost_form_entry_values` (
        `entry_id` int(11) unsigned NOT NULL,
        `field_id` int(11) unsigned NOT NULL,
        `value` text,
        PRIMARY KEY (`entry_id`,`field_id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

      CREATE OR REPLACE VIEW `ost_form_entry_values_uniqueid` AS
      select
      `ost_form_entry_values`.`entry_id` AS `entry_id`,
      `ost_form_entry_values`.`field_id` AS `field_id`,
      `ost_form_entry_values`.`value` AS `value`,
      concat(cast(`ost_form_entry_values`.`entry_id` as char),'|',cast(`ost_form_entry_values`.`field_id` as char)) AS `unique_id`
      from `ost_form_entry_values`;
    */   
    
    public static void main(String args[]) throws Exception {
        Connection conn = DriverManager.getConnection("jdbc:mariadb://localhost/forms?user=root");
        String sql = "SELECT * FROM ost_form_entry_values_uniqueid";
        PreparedStatement stmt = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
        ResultSet rs = stmt.executeQuery();
        rs.next();
        rs.updateString("value", "something");
        rs.updateRow();
        rs.close();
        
    }
    
}
