|
| [WM20 android-Mysql] connect to database via webservice |
| Iniciado por guest, 18,jun. 2015 12:18 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 18,junio 2015 - 12:18 |
I having weird problem when try connect to database via webservice 1. SQLConnectWS() will return OK as long as <Server of Webservice> parameter is correct. even if the rest of parameters are wrong.
2. SQLExec() - if information of database server specify in SQLConnectWS() is wrong, this function will throw exception ( after time out 40 seconds ) " Error in Local Procedure myProcedure process. SQLExec function called.the following error was return b y the server : null" there will be connection show in logs of "reserved webdev server 20"
- if information of database name or database type or user or password specify in SQLConnectWS() is wrong, this function will not return error or throw exception . no connection show in logs of "reserved webdev server 20"
My question is how do I able to tell what is the cause of query return nothing ? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 19,junio 2015 - 05:54 |
Beware when using SQLInfo("QRY") function .
for example
WHEN EXCEPTION IN
IF SQLConnectWS(DB_WebService, DB_Server, DB_UID, DB_PWD, DB_Name, DB_Type) = 0 THEN ExceptionThrow(1,"Error SQLConnectWS (" + G_DB_WebService + ")" )
SQLExec(m_sql, "QRY")
DO IF SQLReqExists("QRY") = True THEN SQLInfo("QRY") else SQLInfo() end Error( "Exception Occured : " + CR+ ExceptionInfo(), "Error code : " + SQL.Error , "Error Message : " + CR + SQL.MesError) END
if DB_Server is assign with invalid IP (not the correct db server IP) , SQLConnectWS will success . SQLExec() will failed and will trigger exception . SQLReqExists("QRY") will return true . when program execute SQLInfo("QRY") . this will trigger Fatal Error "Error in Closing a child widow of WIN_test process. internal error of WDjava Framework. java.lang.NullPointerException. "
if DB_Server assigned with valid IP while DB_UID or DB_PWD or DB_Name or DB_Type is assigned with invalid value , SQLExec() will not trigger exception or return false . the SQLExec() will not return any query result .
is anyone encounter same issues ? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 19,junio 2015 - 06:05 |
for SQLExec(m_sql, "QRY" ) if there is syntax error in the query m_sql is string = [ selec field1 from mytable; ]
SQLExec() will not return false or throw exception, it just return no rows from the query |
| |
| |
| | | |
|
| | | | |
| | |
|