You are not logged in.
Pages: 1
Hello,
I am using the example 13 - StandAlone JSON SQL server, I changed the connection to use MySQL with ZEOS:
Props := TSQLDBZEOSConnectionProperties.Create('zdbc:mysql://localhost:3306/teste?username=root;password=root;MYSQL_OPT_RECONNECT=TRUE','teste', '', '');
The Process function of the standard return is UTF8 but after connection timeout of MySQL the process function returns AnsiString.
To test I put the MySQL server timeout 10 seconds.
Run SQL command that return with special character as select campo from teste
Return before timeout: [{"campo":"Está correto"}]
Return after timeout: [{"campo":"Está correto"}]
Please help
Last edited by sergioschel (2015-08-06 12:11:01)
Offline
Hi ab,
Thanks for return,
how can i do it in reconnecting?
Offline
Avoiding loosing the connection is probably the next best thing after automatic reconnect.
Calling TZConnection.Ping with a smaller than timeout frequency should be enough to practically keep the connection open.
http://dev.mysql.com/doc/refman/5.7/en/mysql-ping.html
I am not sure whether it should be MYSQL_OPT_RECONNECT=TRUE or MYSQL_OPT_RECONNECT=1.
Offline
Pages: 1