aspose file tools*
The moose likes JDBC and the fly likes JDBC: Casting an int array to sql array. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

JDBC: Casting an int array to sql array.

NitishK Kumar
Ranch Hand

Joined: Oct 20, 2010
Posts: 40

Can we cast an int[] to java.sql.Array?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

No. They are not in the same class hierarchy so you can't cast in Java.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
NitishK Kumar
Ranch Hand

Joined: Oct 20, 2010
Posts: 40

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

Joined: Oct 20, 2010
Posts: 40

Thank you, I got the clarity.
And sorry, by mistake I posted the previous problem in this thread.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2476
    
    7

NitishK Kumar wrote:... by mistake I posted the previous problem in this thread.

OK. Let's continue that discussion here.

OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC: Casting an int array to sql array.
 
Similar Threads
Reference
Array class?
Trouble with compiling?
Clarification for such a method
aggregate initialization