Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic