• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

string tokeniser .. error unknown source

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

I want to populate database table by reading the data file which is in this format(manu , kaushik, software , engineer) its not a csv file its a .data file!!! I have used string tokeniser but it is just reading first field of file i.e manu only and giving unknown source error . Where is the problem?


Main class


Model class



and DAOclass method
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
StringTokenizer is no longer the recommended way to split strings, using the String.split() method is now the preferred way.

If you really want to stick with StringTokenizer can you post the full error message and stack trace.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

manu kaushik wrote:Where is the problem?


Manu,

Please DontWriteLongLines. It makes your thread very hard to read, which may put people off answering.

In some cases (eg, your SQL statement string) that even means breaking up Strings into shorter chunks. I've done it for you this time, but please read the link above, and also the UseCodeTags page again.

Thanks

Winston
 
bacon. tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic