Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rectify the 'java.sql.SQLFeatureNotSupportedException' while using the createArrayOf() method

Tags:

java

mysql

jdbc

My code is as follows:

        PreparedStatement pstm = con.prepareStatement("insert into parameter(Parameter) values(?)");
        Array a = con.createArrayOf("TEXT",s1);
        pstm.setArray(1,a);
        pstm.executeUpdate();

The stacktrace is as follows:

   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)

Please help me in rectifying this issue. Thank you in advance.

like image 935
karthikbv Avatar asked Apr 01 '13 13:04

karthikbv


1 Answers

http://docs.oracle.com/javase/6/docs/api/java/sql/SQLFeatureNotSupportedException.html

It means that your mysql driver can't do that operation. Either use a different driver/database, or don't use that method.

like image 117
Thomas Avatar answered Sep 24 '22 21:09

Thomas