This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes Vectors Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Vectors" Watch "Vectors" New topic
Author

Vectors

steph rinert
Greenhorn

Joined: Oct 31, 2002
Posts: 7
Help,
I am using a vector to insert some data into a database but since a vector is wrapped in brackets, I do not get desired affects. Is there a way of inserting a vector into an Oracle DB without inserting the [] brackets thats comes with a vector.
Thanks
steph rinert
Greenhorn

Joined: Oct 31, 2002
Posts: 7
ohh and I wanted to insert the entire vector and not have to go though field by field.
Michael Zalewski
Ranch Hand

Joined: Apr 23, 2002
Posts: 168
If you are writing the Vector into a single column, single row in the database, you could always override the Vector.toString() method to get rid of the brackets:

You can also use the copy constructor just before you write to the database:

Aren't inner classes neat?
steph rinert
Greenhorn

Joined: Oct 31, 2002
Posts: 7
This worked great,
Thanks
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Vectors
 
Similar Threads
Add Row with AbstractTableModel
Vector usage question
How to print out # of bytes used
class level access
how i can get the vector element?