mysql - Java中PreparedStatement的setArray如何正确使用
PHPz
PHPz 2017-04-18 09:41:45
0
2
562
PreparedStatement pstmt = conn.prepareStatement("update message set see=1 where id in (?)");
Array array = conn.createArrayOf("VARCHAR", new Object[]{"1", "2","3"});
pstmt.setArray(1, array);
ResultSet rs = pstmt.executeQuery();

第二句报错 SQLFeatureNotSupportedException
尝试过将VARCHAR都小写还是一样的错

PHPz
PHPz

学习是最好的投资!

reply all(2)
大家讲道理

It has nothing to do with your program. I guess the mysql you are using does not support setArray. Oracle and PostgreSQL support

左手右手慢动作
SQLFeatureNotSupportedException

This exception has been made very clear, and the SQL feature is not supported. Check whether your database version supports it and whether the JDBC driver version corresponds to the database version

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template