aspose file tools
The moose likes JDBC and the fly likes Using java.sql.array Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Using java.sql.array" Watch "Using java.sql.array" New topic
Author

Using java.sql.array

Anita Raj
Greenhorn

Joined: Mar 02, 2003
Posts: 7
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?
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using java.sql.array
 
Similar Threads
How to make list of foreign keys (intermediate SQL question)
Passing Array Elements to Method
how to create array using linked list....
Atomic Variables vs Synchronization
JPA data retrieval query