I have API response which I am using Java insert prepared statement to insert values in DB table.
Few column values coming in from API response is- null. I want to replace this null value with empty string in my table. Can someone help with the piece of code.
Code snippet:
PreparedStatement stmt = conn.prepareStatement(query);
stmt.setDate(1, formatDate(obj.getString("term_dt")));
v==null ? "" : v""when callingformatDate? Possibly you should call PreparedStatement's methodsetNullor provide appropriate default value?