• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

insert data into table

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to some help, I now have my tables created. I'm now trying to load the data into the first table. I have a file that I'm the info from and trying to insert it in the table.

This is not working but I can't find any examples of what would work. I've found examples for insert literals but not variables.
Help!
[ edited to move code block to the left (to alleviate the pain of scrolling left-right) -ds ]
[ April 27, 2003: Message edited by: Dirk Schreckmann ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll assume that you're using a Statement (from a Connection.createStatement() invocation).
Try this modified code out for size.
Before too long of fussing around with funny looking string concatenation and character escaping and single-quote matching, you'll probably want to discover the use of a PreparedStatement. Try a quick search on this forum for example uses of a PreparedStatement.
[ April 27, 2003: Message edited by: Dirk Schreckmann ]
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic