B4J Question jRDC2 and #SQL COMMANDS

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Hi,
Can I add and modify #SQL COMMANDS in the config.properties files with the server running?
I mean without havong to restart it

Any way of not to use #SQL COMMANDS in the config.properties and send it directly from the client?

Thanks
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Can I add and modify #SQL COMMANDS in the config.properties files with the server running?

Yes! just move the file from file.dirassets to file.dirapp (or any other directory)

Any way of not to use #SQL COMMANDS in the config.properties and send it directly from the client?

Yes but this way is more secure, anyway you will be in the need to modify heavily the JRDC module.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
May be I dont fully understand how it works.
You are talking as like the java server is intalled and running in the Android phone.
I suppouse the java server must run in the windows server that holds the MsSql data server
Am I wrong?
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
I suppouse the java server must run in the windows server that holds the MsSql data server

Thats correct, JRDC Server is exclusively for Computer and cannot ran on android (linux and Mac Os are good too)

You are talking as like the java server is intalled and running in the Android phone.

No. File.dirapp and File.direAssets exists too for B4J
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Can I add and modify #SQL COMMANDS in the config.properties files with the server running?

#If Debug is true then this file will be reloaded on every query.
#This is useful if you need to modify the queries.
Debug=true
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
I am confused.
I have only a Files folder under jRDC, no dirApp or dir Assets
I understand that to reload the config without having to recompile each time its enought to have it compiled in Debug mode?
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
@Alberto Michelis

Attached you will find a modified JRDC2, i did not test it but should be okey.

You should use it like this:

B4X:
'Inserted query in the DBCommand
    Type DBCommand (Name As String,query As String, Parameters() As Object)

    Dim dbc As DBCommand
    dbc.Initialize
    dbc.Name = "Query"
    dbc.query = $"
        SELECT * FROM customers WHERE id = ?
    "$
   
    dbc.Parameters = Array As String(1)
   
    'This part only shows how to capture the information, you can modify it for your needs. 
    Dim req As DBRequestManager = CreateRequest
    Dim j As HttpJob = CreateRequest.ExecuteQuery(dbc,0,"")
    Wait For(j) JobDone(j As HttpJob)
    If j.Success Then
        req.HandleJobAsync(j, "req")
        Wait For (req) req_Result(res As DBResult)
        'work with result
        req.PrintTable(res)
    Else
        Log("ERROR: " & j.ErrorMessage)
    End If
    j.Release
 

Attachments

  • ModifiedJrdc.zip
    5.3 KB · Views: 148
Upvote 0
Top