Hi,
I have a C# Windows service that listens to a HTTP port and fires an action upon receiving a HTTP GET request. The action is typically the execution of an application that resides in the same machine (running Windows XP Professional or above).
I now have the requirement for the C# Windows service to listen to incoming SQL queries from a JDBC client and trigger an action, once again, the execution of an application. I am looking for some help to implement a simple 'listener' to receive SQL queries from the JDBC client and trigger the action, after returning a response to the JDBC client. Is there any resource/sample code I can refer to? I do not have the option to install any database server (SQL Express, MySQL, etc) on the target machine.
The XML configuration needs to look like -
<XmlConfiguration>
<SQLListenerPort>18781</SQLListenerPort>
<HttpRootUrl>http://127.0.0.1:8731/</HttpRootUrl>
<HttpsRootUrl>https://127.0.0.1:8732/</HttpsRootUrl>
<ServeHttpsRequests>true</ServeHttpsRequests>
<Triggers>
<!-- Sample triggers for testing, please update for production deployment -->
<Trigger>
<URL>http://127.0.0.1:8731/CustomerID</URL>
<Action>MyExecutable.exe CustomerID</Action>
</Trigger>
<Trigger>
<SQL>SELECT * FROM A/SQL>
<Action>MyExecutable.exe A</Action>
</Trigger>
<Trigger>
<SQL>SELECT * FROM B</SQL>
<Action>MyExecutable.exe B</Action>
</Trigger>
<Trigger>
<URL>https://127.0.0.1:8732/CASE1/CustomerID/MachineID</URL>
<Action>TEST.exe CustomerID MachineID</Action>
</Trigger>
</Triggers>
</XmlConfiguration>
Behaviour -
The C# Windows service receives SQL query 'SELECT * FROM A', looks up the triggers map and fires the executable with an argument (that is, 'A').
Thank you for your time.
indyfromoz