File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQL Server replacing characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Server replacing characters" Watch "SQL Server replacing characters" New topic
Author

SQL Server replacing characters

Rik Sweeney
Ranch Hand

Joined: Sep 04, 2001
Posts: 36
Whenever I attempt to retrieve my data from an SQL Server database or a MSAccess database characters like apostrophes ' or double quotes " are changed into other characters such as / and ?. I've checked the database and the data is correct. Has anyone else experienced this problem and does anyone know a solution?
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
How is the data stored in your database? Are they stored as ' and " marks?


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Rik Sweeney
Ranch Hand

Joined: Sep 04, 2001
Posts: 36
Originally posted by Dale DeMott:
How is the data stored in your database? Are they stored as ' and " marks?

They're stored as " and '. I have noticed though that if I copy a cell out of access and paste it into, say, notepad I get a formatted ' like Word would do.
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
Is it always the same characters that appear instead of the apostrophe and double quote?
What JDBC driver are you using? JDBC - ODBC bridge?
What happens with Oracle or mySQL?


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Rik Sweeney
Ranch Hand

Joined: Sep 04, 2001
Posts: 36
It is always the same characters. I've found out that Microsoft format their single and double quotes like they would in word, instead of the conventional ' or "
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
Hi Rik,
SQL Server is doing this too? I'm not sure I understand what you mean. Surely the character stored in the database is just the character. When is it being formatted, and what is formatting it? The JDBC driver or the database?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Server replacing characters