If your application runs on databases from different vendors and you want some PreparedStatement objects to contain precompiled statements and others to contain uncompiled statements, use the PreparedStatement in portable applications.
When you access a SAP SAP database, make sure that the DYNAMIC_PREPARE connection property is set to true.
PreparedStatement ps_precomp = Connection.prepareStatement(sql_string);
To return PreparedStatement objects containing uncompiled statements, use Connection.prepareCall.
PreparedStatement ps_uncomp = Connection.prepareCall(sql_string);
The PreparedStatement object ps_uncomp is guaranteed to contain an uncompiled statement, because only Connection.prepareStatement is implemented to return PreparedStatement objects containing precompiled statements.