Call procedure from java

0

I have a database created with the hsqldb manager.

Within that scheme I have a procedure that is as follows:

create procedure insertarUsuario
(nombre varchar(50), apellidos varchar(50), usuariowin varchar(10),xlnet varchar(10), correo varchar(150), planta integer, telefono integer)
MODIFIES SQL DATA
BEGIN ATOMIC
INSERT INTO USUARIOS VALUES(nombre, apellidos, usuariowin, xlnet,correo,planta,telefono);
end;

This procedure I call it in the following way in java

public static void main(String[] args) throws SQLException {
   ConexionBBDD con = new ConexionBBDD();

    String sql = "{call public.insertarUsuario(?,?,?,?,?,?,?)}";

    CallableStatement cs = con.getConnection().prepareCall(sql);

        cs.setString(1, "esto");
        cs.setString(2, "es");
        cs.setString(3, "una");
        cs.setString(4, "prueba");
        cs.setString(5, "insercion");
        cs.setInt(6, 1);
        cs.setInt(7, 2);

        cs.execute();
        cs.close();

        con.desconexionBBDD();  
}  

And this is what java returns to me:

Exception in thread "main" java.sql.SQLSyntaxErrorException: usuario no tiene privilegios suficientes o objeto no encontrado: INSERTARUSUARIO
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCCallableStatement.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.prepareCall(Unknown Source)
    at ventanas.pruebaConexion.main(pruebaConexion.java:28)
Caused by: org.hsqldb.HsqlException: usuario no tiene privilegios suficientes o objeto no encontrado: INSERTARUSUARIO
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.ParserDQL.readColumnOrFunctionExpression(Unknown Source)
    at org.hsqldb.ParserDQL.XreadSimpleValueExpressionPrimary(Unknown Source)
    at org.hsqldb.ParserDQL.XreadAllTypesValueExpressionPrimary(Unknown Source)
    at org.hsqldb.ParserDQL.XreadAllTypesPrimary(Unknown Source)
    at org.hsqldb.ParserDQL.XreadAllTypesFactor(Unknown Source)
    at org.hsqldb.ParserDQL.XreadAllTypesTerm(Unknown Source)
    at org.hsqldb.ParserDQL.XreadAllTypesCommonValueExpression(Unknown Source)
    at org.hsqldb.ParserDQL.XreadValueExpression(Unknown Source)
    at org.hsqldb.ParserDML.compileCallStatement(Unknown Source)
    at org.hsqldb.ParserCommand.compilePart(Unknown Source)
    at org.hsqldb.ParserCommand.compileStatement(Unknown Source)
    at org.hsqldb.Session.compileStatement(Unknown Source)
    at org.hsqldb.StatementManager.compile(Unknown Source)
    at org.hsqldb.Session.execute(Unknown Source)
    ... 4 more

If I do a call in the manager, it does it well, if I do the same call to an oracle rula but here it hurts me.

    
asked by Bruno Castro 21.09.2017 в 12:18
source

1 answer

-2

Solved. The problem was in the connection file that had something that did not come to mind, so I hit the shell.

    
answered by 19.10.2017 в 11:58