When running the following code:
if (loja.length() > 0) { pstmt2.setString(3, loja.substring(0,68)); } else { pstmt2.setString(3, "_"); }
java.lang.StringIndexOutOfBoundsException: String index out of range: 68
loja is shorter than 68 chars: StringOutOfBoundsException is being thrown.
StringOutOfBoundsException