The first mistake is that the statement is a SELECT statement :
String s = "SELECT * FROM TEST VAL like ?";
but you are trying to call p.executeUpdate();
According to the documentation of: PreparedStatement#ecexuteUpdate()
Executes the SQL statement in this PreparedStatement object, which
must be an SQL Data Manipulation Language (DML) statement, such as
INSERT, UPDATE or DELETE; or an SQL statement that returns nothing,
such as a DDL statement.
that is - this method is not intended for execution of SELECT statement. Only INSERT, DELETE, UPDATE or an SQL that returns nothins - SELECT returs a resultset.
Another mistake is that according to the documentation of LIKE operator their arguments can be only of the following datatypes:
char1 LIKE char2 [ ESCAPE asc_chars ]
All of the character expressions
(char1, char2, and esc_char) can be of any of the data types CHAR,
VARCHAR2, NCHAR, or NVARCHAR2. If they differ, then Oracle converts
all of them to the data type of char1.
As you see, BLOB datatype are not alloved here as parameter. BLOB datatype was used as a parameter of LIKE operator --> p.setBlob(1,blob);, therefore the error was thrown: ORA-06553: PLS-306: wrong number or types of arguments in call to 'CAST_TO_VARCHAR2' because Oracle tried to cast BLOB to VARCHAR2 datatype, but this cast is not allowed.
(String)"yes"? It's redundant.