• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use sql.Array

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Grow your own food... or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic