marcick Well-Known Member Licensed User Longtime User Jan 4, 2016 #1 Hi everybody and happy new year. I need to implement some code in JRDC (server side, not client) to do a simple manteinance operation on the database For example: "DELETE FROM mytable WHERE sdate<"2015-05-01 12:00:00" No difficult to do it creating the command in config.properties and doing the operation client side, but I need to do it server side in JRDC. I'm tryng to understand the code but have some difficulties... Any hints ? ... solved ! what a stupid question, it was so easy ... Last edited: Jan 4, 2016
Hi everybody and happy new year. I need to implement some code in JRDC (server side, not client) to do a simple manteinance operation on the database For example: "DELETE FROM mytable WHERE sdate<"2015-05-01 12:00:00" No difficult to do it creating the command in config.properties and doing the operation client side, but I need to do it server side in JRDC. I'm tryng to understand the code but have some difficulties... Any hints ? ... solved ! what a stupid question, it was so easy ...
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2016 #2 marcick said: .. solved ! what a stupid question, it was so easy ... Click to expand... Better to post the solution... Upvote 0
marcick said: .. solved ! what a stupid question, it was so easy ... Click to expand... Better to post the solution...
marcick Well-Known Member Licensed User Longtime User Jan 5, 2016 #3 yep ... Code: Copy DIM rdcConnector1 As RDCConnector rdcConnector1.initialize Dim con As SQL = rdcConnector1.GetConnection con.ExecNonQuery("DELETE FROM mytable WHERE sdate < " & Chr(34) & "2015-05-01 12:00:00" & Chr(34)) Upvote 0
yep ... Code: Copy DIM rdcConnector1 As RDCConnector rdcConnector1.initialize Dim con As SQL = rdcConnector1.GetConnection con.ExecNonQuery("DELETE FROM mytable WHERE sdate < " & Chr(34) & "2015-05-01 12:00:00" & Chr(34))
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2016 #4 Almost... Don't create a new RDCConnector. Use Main.rdcConnector1. It is a "heavy" object as it starts a db pool. Code: Copy Dim con As SQL = Main.rdConnector1.GetConnection con.ExecNonQuery(...) con.Close 'don't leak connections Upvote 0
Almost... Don't create a new RDCConnector. Use Main.rdcConnector1. It is a "heavy" object as it starts a db pool. Code: Copy Dim con As SQL = Main.rdConnector1.GetConnection con.ExecNonQuery(...) con.Close 'don't leak connections