Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in getting correct data

 
duhit Choudhary
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I wrote a program to insert user details from a website into a database table. all the program is working fine except a thing, which is, the database is not taking the correct value although i am getting the correct value at the console..
here is my code and details:



and the line from where i am inserting the data into database is:



the above code is in separate class and there is another class where i defined setter getter methods:



dto is the object of the class in which i have defined setter getter methods.

now the output i m getting on console is:

Collinsville, IL
United States
Address : Collinsville, IL
United States

but on the database table it is entering oly first line of the output at Address column... like- Collinsville, IL
please help me out to get the correct and full data in the table..

Thanks in advance
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

can you try to use PreparedStatement and parameters, in stead of collating a n sql string together?

How do you check what has been entered in the database? What tool are you using to look at the values?
What does your database table looklike?

Regards, Jan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic