This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing Hypen in database from java

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a String which contains a hypen. I am using JDBC to connect to Oracle 10g database. When the string content is stored in the database hypen gets converted to inverted question mark.

Any suggestion on how to retain the hypen in database is greatly appreciated.

[ September 23, 2008: Message edited by: Vishnu Prakash ]
[ September 23, 2008: Message edited by: Vishnu Prakash ]
 
Srikanth Basa
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code you are using ?
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the string content is stored in the database hypen gets converted to inverted question mark.
Where - and how - do you see that it is stored in the database as a question mark?

quote
When data character set conversion is required, the target character set should be a superset of the source datafile character set. Otherwise, characters that have no equivalent in the target character set are converted to replacement characters, often a default character such as a question mark (?). This causes loss of data.

Data Conversion in JDBC
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic