• 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

Problems with accents in Java+Derby (Netbeans)

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys, I have a problem in Java + DerbySQL, I'm having trouble with accents, because when I search for a word that has accent, do not get results. I did a debug the code and noticed that the java (NetBeans IDE) puts in place the letter with the accent question mark (?) And at query time he seeks the word with this question in a word, or where the accent exists in my code is a string variable that receives the data entered by the user, and this variable is set in the SQL search string (example: ), I'm using the Derby database, I did the same search words with accents and worked properly at the derby console, inside the tab" Services "NetBeans, so I think the problem is in java, how to String variable P1 recognize accents and properly send the quest for the Derby? How can I solve this?
 
Ranch Hand
Posts: 36
Eclipse IDE Java ME Oracle
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Marvin Legend wrote:
...


You should be using a PreparedStatement and let the jdbc statement do all the escaping for you. This is also prevent SQL injection too. And your code should be:
 
reply
    Bookmark Topic Watch Topic
  • New Topic