Android Question About RDC

MohammadNew

Active Member
Licensed User
Longtime User
Hello everyone , Could you give me answer please ?

I saw the thread about RDC

https://www.b4x.com/android/forum/t...connector-rdc-connect-to-any-remote-db.31540/

I talk about Mysql

This fie after modify
DriverClass= what I write her
JdbcUrl= also

SS-2013-08-04_16.10.20.png


where put it ? can I put it in my hosting not localhost like php file and just alone or with other files ?

Where is jdbc_driver folder ?

until now this questions enough :)

Thanks alot .

Warm Regards
 

Anser

Well-Known Member
Licensed User
Longtime User
Hello everyone , Could you give me answer please ?

I saw the thread about RDC

https://www.b4x.com/android/forum/t...connector-rdc-connect-to-any-remote-db.31540/

I talk about Mysql

This fie after modify
DriverClass= what I write her
JdbcUrl= also



where put it ? can I put it in my hosting not localhost like php file and just alone or with other files ?

Where is jdbc_driver folder ?

until now this questions enough :)

Thanks alot .

Warm Regards
if you are using MySQL then yo dont have to change anything

DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://YourMySqlServerIP:YourMySqlPortNumber/YourDatabaseName?characterEncoding=utf8
Where is jdbc_driver folder ?
It is mentioned in the post itself https://www.b4x.com/android/forum/t...connector-rdc-connect-to-any-remote-db.31540/
http://dev.mysql.com/downloads/connector/j/
 
Upvote 0

MohammadNew

Active Member
Licensed User
Longtime User
Thanks Anser, could you tell me can I put it in my hosting (smarterasp.net) or just localhost ?

I downloaded the mysql-connector-java-5.1.41

where is the jdbc_driver folder ?

Thanks again.
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
could you tell me can I put it in my hosting (smarterasp.net) or just localhost ?

If you are having a VPS server with your hosting provider then you can put jRDC folder anywhere on that server. The jRDC.jar should run on the server.

where is the jdbc_driver folder ?

If I am not wrong, the driver will be included in the jRDC.jar
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
can I put it in my hosting (smarterasp.net)
if you have a VPS with Remotedesktop root access, then yes.
The cheap hosting does not have root access so you are not able to start a java server i guess.

Best is to ask [email protected]
 
Upvote 0

MohammadNew

Active Member
Licensed User
Longtime User
It is more secure to put the statements in the php file. Make sure to correctly escape all parameters.

this is php file how to modify it to write the sql statement inside the php file ? give me your help please .

B4X:
<?php

$databasehost = "";
$databasename = "";
$databaseusername ="";
$databasepassword = "";

$con = mysqli_connect($databasehost,$databaseusername,$databasepassword, $databasename) or die(mysqli_error($con));
mysqli_set_charset ($con , "utf8");
$query = file_get_contents("php://input");
$sth = mysqli_query($con, $query);

if (mysqli_errno($con)) {
   header("HTTP/1.1 500 Internal Server Error");
   echo $query.'\n';
   echo mysqli_error($con);
}
else
{
   $rows = array();
   while($r = mysqli_fetch_assoc($sth)) {
     $rows[] = $r;
   }
   $res = json_encode($rows);
    echo $res;
    mysqli_free_result($sth);
}
mysqli_close($con);
?>
 
Upvote 0
Top