Results 1 to 3 of 3
- 01-16-2011, 12:54 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 6
- Rep Power
- 0
How To insert non-english Strings to Database
Hello ,
I need to insert non-english Strings into a database , i am using mysql database, and the non-english text is "arabic"
Now i set the collation of my database,tables and fields to
"utf8_general_ci"
anyway , i have no problem reading from database in to the application.
it reads arabic text successfully , the problem is when i try to write to the database. the String displays at the database is "??????" instead of the actual text.
Any Suggestions ?!!
Thank You for your time
- 01-16-2011, 04:23 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,604
- Rep Power
- 5
See the following link: MySQL :: MySQL 5.0 Reference Manual :: 20.3.4.4 Using Character Sets and Unicode
It explains that the JDBC Driver for ConnectorJ uses client encoding for data transfer from client to server, so you should specify the encoding using the characterEncoding property in the url, something like:
Java Code:jdbc:mysql://localhost:3306/db_name?useUnicode=yes&characterEncoding=UTF-8
- 01-16-2011, 06:06 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
insert vector to database
By jperson in forum JDBCReplies: 4Last Post: 01-20-2011, 02:42 AM -
how to insert data in database
By Vinay Bhatia in forum JDBCReplies: 6Last Post: 11-03-2010, 04:06 PM -
How to insert random number to database
By waboke in forum New To JavaReplies: 1Last Post: 09-24-2010, 04:45 PM -
why i can't insert data to database
By khaa_khay in forum Web FrameworksReplies: 0Last Post: 05-26-2010, 05:37 AM -
How to insert large data into database using one insert query
By sandeepsai39 in forum New To JavaReplies: 3Last Post: 02-28-2009, 09:17 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks