Skip to Content
0
Feb 03, 2023 at 03:23 AM

Its possible to insert data via JDBC to Hana Cloud ?

177 Views Last edit Feb 03, 2023 at 03:24 AM 2 rev

Tutorials: https://developers.sap.com/tutorials/hana-clients-jdbc.html

The connection is working properly and resultsets too but whenever I try to insert data, Hana Cloud skips an index

from id_cliente and data is not inserted.
--------------------------

  public void InsertEmpleado(String Nombre) {

        cn.conect();
        String Action = "INSERT INTO DBADMIN.CLIENTE\n" + "(NOMBRE_CLIENTE)\n"
                + "VALUES( ?);";

        try {
            PreparedStatement preparedStmt = cn.cx.prepareStatement(Action);

            preparedStmt.setString(1, Nombre);

            preparedStmt.executeUpdate();
            cn.Disconnect();

        } catch (SQLException ex) {
            Logger.getLogger(Query.class.getName()).log(Level.SEVERE, null, ex);
            System.out.println("NO SE PUDO");
        }

    }