D
D
Denis Kuznetsov2020-11-01 20:23:52
Java
Denis Kuznetsov, 2020-11-01 20:23:52

Is it possible to call a sql function through prepared Statement in java?

Through pgAdmin I created a function for my database, can I call this function when creating a request on the server using preparedStatement, that is, pass it the following line as an argument:

private static final String SQL_FUNC_REQUEST = "Select addNode(?, xmlelement(name action, xmlattributes('? as billId, 
? as name), \n" +
            "\t\t\t\t\t\t\t xmlelement(name status, ?)));";

PreparedStatement preparedStatement = connection.prepareStatement(SQL_FUNC_REQUEST)

My function has the following signature:
create or replace function addNode(xmlId integer, newNode xml)
returns void as ...

That is, he will see this function after it has been created, do I understand correctly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question