wood burning stoves 2.0*
The moose likes JDBC and the fly likes Storing Hypen in database from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Storing Hypen in database from java" Watch "Storing Hypen in database from java" New topic
Author

Storing Hypen in database from java

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
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 ]

Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Srikanth Basa
Ranch Hand

Joined: Jun 06, 2005
Posts: 241
Can you post the code you are using ?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

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


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storing Hypen in database from java
 
Similar Threads
short-name element in tld
jsp filters
Sending request through links
help me,thank u
Is Filter Mutli-threaded?