3

I have a sql script for oracle database:

set define off;
   CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "XYZ" AS
   import javax.crypto.SecretKey;
.......
   import java.security.NoSuchProviderException;
public class XYZ {
   .... fields
   .... methods
}
/

I'm trying to execute this statement using following java code:

String createStoredProcedureSqlString = new String(Files.readAllBytes(storedProcedureSqlFile.toPath()));
try (Connection connection = dataSource.getConnection();
     Statement statement = connection.createStatement()) {
    statement.execute(createStoredProcedureSqlString);
    }

After executing this code I faced with exception message:

java.sql.SQLException: Non supported SQL92 token at position: 479

I believe that this exception occurs while script contains "{" or "}" symbols. But I don't really know how to escape them and not affect script itself.

What am I doing wrong?

0 Answers0