September 2018
Intermediate to advanced
802 pages
19h 30m
English
As in the previous recipe, we will continue using the PostgreSQL database for demonstration purposes. Before writing custom SQL statements, functions, and stored procedures, you should look at the list of already existing functions first. Usually, they provide a wealth of functionality.
Here is an example of calling the replace(string text, from text, to text) function that searches the first parameter (string text) and replaces it with all the substrings that match the second parameter (from text ) with the substring provided by the third parameter (string text):
String sql = "{ ? = call replace(?, ?, ? ) }";try (CallableStatement st = conn.prepareCall(sql)) { st.registerOutParameter(1, Types.VARCHAR); st.setString(2, "Hello, ...
Read now
Unlock full access