質問

I am getting an error in connecting SAP HANA with PHP using odbc drivers.

Below is my error. Note: I can insert first data, but can't fetch the data. Can't insert second data.

Warning: odbc_connect(): SQL error: [unixODBC][SAP AG][LIBODBCHDB SO][HDB] Communication link failure;-10709 Connection failed (RTE:[89006] System call 'connect' failed, rc=110:Connection timed out), SQL state 08S01 in SQLConnect in /home/saphana/config.php on line 9 Warning: odbc_exec() expects parameter 1 to be resource, boolean given in /home/saphana/savedata.php on line 22 Warning: odbc_fetch_row() expects parameter 1 to be resource, null given in /home/saphana/savedata.php on line 24 Warning: odbc_exec() expects parameter 1 to be resource, boolean given in /home/saphana/savedata.php on line 32 Warning: odbc_exec() expects parameter 1 to be resource, boolean given in /home/saphana/savedata.php on line 34 Warning: odbc_fetch_row() expects parameter 1 to be resource, null given in /home/saphana/savedata.php on line 40 Notice: Undefined variable: ID in /home/sanjay/savedata.php on line 47

Please Help !!!!!

This is my file:

?php session_start();
$driver         = "HANADB"; // 32 bit odbc drivers that come with the hana client      installation.

$servername  = "saphfvb.vm.cld.sr:30015";

$db_name        = "HDB";        // This is the default name of your hana instance. 

$username       = "SYSTEM"; // This is the default username, do provide your username

$password       = "xxxxxx";  // This is the default password, do provide your own   password.

$conn = odbc_connect("HANADB","SYSTEM","manager",SQL_CUR_USE_ODBC);
役に立ちましたか?

解決

Well, if you said you had a successful insert previously, it means the connection string works fine. The only issue I can see here is your server is no longer running. Cloudshare suspends the server every 60 mins (can be extended to 180), and your error message sounds exactly that.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top