on 2020 Jan 13 7:48 PM
SAP HANA DB version - 2.0SP3
ngdbc.jar version - 2.4.67
I am trying to use setClob on PreparedStmt and I am getting error "com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Cannot convert Java type java.sql.Clob to SQL type CHAR."
I came across a link where it states that createClob() of Connection is not supported in ngdbc driver (https://answers.sap.com/questions/512100/method-createclob-of-connection-is-not-supported-i.html), and as a work around an answer is proposed. I made use of that code snippet and I am trying to set Parameter using setClob.
String value = 'ABC';
PreparedStatement dummyclob = conn.prepareStatement("SELECT TO_CLOB ('" + value + "') FROM DUMMY;");
ResultSet rs = dummyclob.executeQuery();
Clob objClob = null;
if (rs.next()) {
objClob = rs.getClob(1);
}
pstmt.setClob(i+1, objClob);
at setClob I am getting error as "com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Cannot convert Java type java.sql.Clob to SQL type CHAR."
Can anyone help me with solution to this?
Request clarification before answering.
User | Count |
---|---|
87 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.