It's not a secret anymore!*
The moose likes JDBC and the fly likes How to use sql.Array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to use sql.Array" Watch "How to use sql.Array" New topic
Author

How to use sql.Array

Sarah Gaikwad
Ranch Hand

Joined: Feb 26, 2004
Posts: 35
Hi ,
I have an array of objects and want to convert it to sql.Array.

I tried looking on the net but to no avail. This site has always come to my rescue.

I have an array of Objects. How do I convert it to sql.Array.


Thanks a lot.
Sarah
todd runstein
Ranch Hand

Joined: Feb 15, 2005
Posts: 64
Sarah,

I'm kind of curious what it is you're trying to do - I know you want to make a java.sql.Array, but why? What do you intend to do with it after that?

Because Array is an interface, you'll probably need to create your own instance:

public class MyArray implements Array{
....
}

Create a constructor for this class that accepts Object[], and you've got an Array. Of course, you'll need to implement all the methods defined in the Array interface.

I hope this helps (though I suspect this isn't the answer you were looking for).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use sql.Array
 
Similar Threads
convert an array of String to char
convert array to Arraylist
How to convert a number into an Array
how to use ArrayList to Array() to get array of doubles
Array of Objects to be passed into a method