Java readyStatement with setBigDecimal parameter raises ORA-03115

The problem is this: I set the prepared condition for the query in a table with these fields (among others):

TABLE1_RSPN NUMBER(8,0)
TABLE1_AFDV NUMBER(8,0)
TABLE1_VALUE    NUMBER(17,2)
TABLE1_NOTE VARCHAR2(255 BYTE)
TABLE1_USR  VARCHAR2(20 BYTE)

...

Trying to get some information in my Java application, I set up a prepared state that creates an unsupported network type or Oracle ORA-03115 view.

The corresponding Java code is as follows:

sentSQL = "SELECT TABLE1.*, TABLE2.CIAS FROM TABLE1, TABLE2 WHERE TABLE1_RSPN = ?" +
" AND TABLE2_AFDV = TABLE1_AFDV";
ps = con.prepareStatement(sentSQL);
ps.setBigDecimal(1, dto.getCodResponsability());
rs = ps.executeQuery(sentSQL);

CodResponsability - BigDecimal. I also tried with Double and Long, without joy.

Thanks in advance for your help!

+3
source share
1 answer

This line is probably incorrect:

rs = ps.executeQuery(sentSQL);

Statement executeQuery .

rs = ps.executeQuery();
+5

Source: https://habr.com/ru/post/1733605/


All Articles