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
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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

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: 2510
    
  10

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JDBC: Casting an int array to sql array.