This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

JDBC: Casting an int array to sql array.

 
NitishK Kumar
Ranch Hand
Posts: 40
Chrome Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can we cast an int[] to java.sql.Array?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
No. They are not in the same class hierarchy so you can't cast in Java.
 
NitishK Kumar
Ranch Hand
Posts: 40
Chrome Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Sir, I wrote following code:

package jdbc2.array;
import java.sql.*;

It compiled successfully but when I executed it, I got the error as follows:

Exception in thread "main" java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.createArrayOf(Ljava/lang/String;[Lja
va/lang/Object;)Ljava/sql/Array;
at jdbc2.array.ArrayStore2.main(ArrayStore2.java:12)

I am using oracle 10g express edition. Is there is problem with driver or something else? Please help me.
 
NitishK Kumar
Ranch Hand
Posts: 40
Chrome Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thank you, I got the clarity.
And sorry, by mistake I posted the previous problem in this thread.
 
Jan Cumps
Bartender
Posts: 2599
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
NitishK Kumar wrote:... by mistake I posted the previous problem in this thread.

OK. Let's continue that discussion here.
 
    Bookmark Topic Watch Topic
  • New Topic