一例ORA-03115: unsupported network datatype or representation错误

java.sql.SQLException: ORA-03115: unsupported network datatype or representation

错误代码:

String sql = "...";
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.setInt(1, intValue);
List> list = new ArrayList>();  
ResultSet rs = stmt.executeQuery(sql);

错误原因:

ResultSet rs = stmt.executeQuery(sql); 里面不能再写参数了,sql多余。

正确代码:

String sql = "...";
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.setInt(1, intValue);
List> list = new ArrayList>();  
ResultSet rs = stmt.executeQuery();

你可能感兴趣的:(一例ORA-03115: unsupported network datatype or representation错误)