For an application in which most dynamic SQL statements are likely to be executed only once or twice in a session:
Set the connection property DYNAMIC_PREPARE to "false."
To return PreparedStatement objects containing uncompiled statements, use Connection.prepareStatement in the standard way:
PreparedStatement ps_uncomp = Connection.prepareStatement(sql_string);
To return PreparedStatement objects containing precompiled statements, use SybConnection.prepareStatement with dynamic set to "true," as shown:
PreparedStatement ps_precomp = (SybConnection)conn.prepareStatement(sql_string, true);