• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Using java.sql.array

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need help about working with arrays in an access database.
1) How do you use array in create table statement?

stmt.executeUpdate("CREATE TABLE tblA (ID INT PRIMARY KEY, Var2 INT, Var3 VARCHAR(50), ???)");
//I want Var4 to be an array
2) How do you insert values into Var4, which is initially an empty array?
3) Retrieving an array. Is this correct?
ResultSet rs = stmt.executeQuery(
"SELECT Var4 FROM tblA WHERE ID = 200");
rs.next();
Array arrVar4 = rs.getArray("Var4");
4) How do you update Var4 using updateArray?
 
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Oracle you do it like this:
ArrayDescriptor desc = ArrayDescriptor.createDescriptor("<array name>", connection);
ARRAY newArray = new ARRAY(...);
Don't know if it applies to access?
 
What's that smell? Hey, sniff this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic