I am using Prepared Statement like the following :
List<Integer> ids = new ArrayList<Integer>();
ids.add(SelectQueueRS.getInt("DTSId_int"));
PreparedStatement updateOriginal = connMain.prepareStatement(
"UPDATE test.selectiontable SET DTSStatusType_ti = 3, Queued_DialerIP_vch = ?" +
"WHERE DTSId_int IN (?)");
updateOriginal.setString(1, CurrRemoteIPAddress);
updateOriginal.setArray(2,connMain.createArrayOf("string", ids.toArray()));
updateOriginal.executeUpdate();
Getting the error on line :
updateOriginal.setArray(2,connMain.createArrayOf("string", ids.toArray()));
Here is my stack trace:
Exception in thread "main" java.sql.SQLFeatureNotSupportedException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at com.mysql.jdbc.SQLError.notImplemented(SQLError.java:1329)
at com.mysql.jdbc.JDBC4Connection.createArrayOf(JDBC4Connection.java:56)
at project.Project.main(Project.java:295)
I have gone through some old Stackoverfolow posts discussing about the same issues here where many people
have suggested not to use createArrayOf
method.
1) I am wondering, if I can update my JDBC driver so that I don't have to change any method in my code?But before that, I will have to check in NEtbeans, which version I am currently using. Any idea how to check that?
2) If not above step, please advise what changes I can do?
Thanks
Some posts I have referred: How to rectify the 'java.sql.SQLFeatureNotSupportedException' while using the createArrayOf() method