It's not a secret anymore!*
The moose likes JDBC and the fly likes insert query for mysql  convert() using the tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "insert query for mysql  convert() using the tomcat" Watch "insert query for mysql  convert() using the tomcat" New topic
Author

insert query for mysql convert() using the tomcat

zita lakshmi
Ranch Hand

Joined: Nov 13, 2009
Posts: 37

Hi


I need insert query for mysql convert() using the tomcat




it have error.


so any one of them help me
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Shouldn't you convert each column separately?
Moving to JDBC.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
zita lakshmi wrote:it have error.


And what does the error say..?


OCJP 6 (93%)
zita lakshmi
Ranch Hand

Joined: Nov 13, 2009
Posts: 37

hi

Thanks for your reply. I have using for the following code



but it have the following error message.

Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') using utf8, convert('اليتا') using utf8)' at line 1"

how can i insert the arabic data properly. please help me.
zita lakshmi
Ranch Hand

Joined: Nov 13, 2009
Posts: 37
hai

Manually i tried to insert the data in mysql. but i have following error.



Error

SQL query:

INSERT INTO arabiccontent( `id` , `name` )
VALUES (
convert( "444" )
USING utf8, convert( "وكيل إدارة" )
USING utf8
)

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') using utf8, convert("وكيل إدارة") using utf8)' at line 1



Please help me
Prabhat Jha
Ranch Hand

Joined: Aug 13, 2007
Posts: 58
Which OS are you running on and what is the version of MySQL that you are using ? MySQL 4.x had similar problems.

Just to double check that your version supports Arabic can you check SHOW CHARSET shows you arabic or not ?

Thanks


Thanks,
Prabhat
SCJP 1.5, SCWCD 1.5, SCBCD 1.5
zita lakshmi
Ranch Hand

Joined: Nov 13, 2009
Posts: 37


hi


Mysql accept arabic charset.


Os version is window XP


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: insert query for mysql convert() using the tomcat
 
Similar Threads
problem while inserting the record in db using mySQL
@Generatedvalue and MySQL
query is not getting executed
how to get the inserted record by using resultset in java?
replaceToken with multiple lines