This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Vectors

 
steph rinert
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohh and I wanted to insert the entire vector and not have to go though field by field.
 
Michael Zalewski
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This worked great,
Thanks
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic