I would like to insert data into sql table from append logs while using smslib - sql-server

I made a java application for sending SMS via Huwei Modem. Everything is working properly. I used netbeans for making this java application. According to this application, logs data will appear in Jtext Area after sending SMS to any receipt such as Receipt name, number, message and status of the message. But I would like to insert these logs data into SQL table.
I tried to mentioned below link but failed
https://www.tutorialspoint.com/log4j/log4j_logging_database.htm
{ jTextAreaLog.append(msg.toString()); }
void appendToJTextAreaLog(String txt)
{
jTextAreaLog.append(txt);
}

Related

How to format powershell output in Logic App

I am trying to fetch expiry date of all the webhooks using an runbook and then sending that output in an email using logic app.
Below is the script to get webhook expiration date which will be stored in an hashtable
Powershell Script
This is the powershell output on the screen
Powershell Output
But this is the format in whic i am getting the email
Email Notification
Can anyone explain how to get email notification in table format ?
I am using get job output connector to get the runbook output and i select (Content) to get the output from previous step
Logic App Email Connector
You are receiving this because the output from runbooks is read in a paragraph tag inside the mail connector. After reproducing from my end, I could get the answer usingpre tag which defines preformatted text. Alternatively, you can send the output as attachment to the mail which gives you output in the required format. Below is the flow of my logic app.
Results in mail:

Discord API for Search, Channels, and Messages

I'm new to Discord and would like to know whether Discord provides APIs for the following purposes:
I would like to send a search keyword in the request and would like to receive in response all public servers / channels that are a match. (This is similar to the 'Explore Public Server' functionality available in the Discord web and desktop front-ends (but not on mobile devices)
The user goes through the search results and select one of the results. Now, I would like to send this server (server name or server Id) in the request and expect to get the list of public channels on this server.
The user then selects one of the public channels. Now I send the channel id in the request and expect to receive the messages along with their corresponding usernames and datetime they were posted in the channel.
I tried to refer to the API documentation but was unable to figure out. I plan to use Java API (JAX-RS) with Jersey.
Thanks,
Dicky

Correct configuration of SignalR for long running process

Scenario: WPF application that sends a file to a server and the server, in turn, performs a series of validations that can take several minutes, during which the server sends a series of messages to tell the application what it is doing (signalr), in at the end of everything, it warns that the process has ended.
What I'm doing: Every time the application is sending a new file I start the hub await hubConnection.Start() and at the end of it all I stop.
The process consists of: doing some local validations, sending the file to the server, monitoring the processing (signalr) and at the end, if applicable, downloading a file with the error;
It's all working fine, but I'm afraid something might go wrong along the way, flag not sending the messages, etc.
My question: What is the correct way to do this? When should I connect the hub (await for hubConnection.Start())? Should I do this when starting the app? How do I receive the messages later (in each message I have an identifier of the file I am working on)?

Mobile to Web Service Communication

I created a web service and a mobile application that communicate between each other. When everything is working, it works great. When the server doesn't respond, it starts to break down.
The mobile device sends a message to the server with a bunch of records. Getting the records on the server never seems to be a problem. It gets the records and then sends a response back to the mobile device that the update was received. The PROBLEM is that the mobile device doesn't always get the response, so it doesn't know it shouldn't send those records again for updating.
Next time it sends the records again and now I have duplicate records. How can I solve this?
Idea 1) Create a transaction number unique on the mobile device that I can compare against the server to see if the record was already uploaded. Then just don't write that record and attempt to send back the response that it was written.
Idea 2) Send the records to the server, but before writing them respond to the mobile device that they were received. This way the mobile device can tag them and then send another response to the server telling it to write them. At the point the mobile device almost doesn't care if it gets a response. Only thing, you don't know if the server ever got the message.
Looking for ideas on how to handle this that either confirm one of these ideas or has a completely different one.
I ended up creating logs that the device attempts to resolve when it gets back successful responses from the server.
I tag items as a batch of lines and send them up to the server. Once they are up there, I create a log about the success or failure of each line item in a batch of items and then save the log to the file system.
When the mobile device is unsuccessful in hearing back a response from the server, in rare cases, it asks the server about a batch number. If the server doesn't respond with a status of that batch, it assumes the server never received it and remarks those items for another upload attempt. If it hears back, it processes the success and failure line by line and then marks the items on the mobile device accordingly. If the mobile device doesn't ask about the log in the next upload, the server assumes the batch's lifecycle is complete and it no longer needs to maintain that log. It is then deleted.
The server doesn't delete a log until it has a successful request from the specific device no longer asking to hear about the log. So if I have log 1 on the server and the device doesn't ask in the next upload to hear back about that log, the server then removes that log assuming the device got the response it wanted or doesn't care about it anymore.

Intermittent Handshake Error

Background
We currently have a SilverLight form that posts data to a second common form that multiple applications use, which then runs the need business logic to place the data into a database.
We have several national and international offices where this form is used.
There is one office location (CO) where this form is consistently producing intermittent error messages and based off log data, it is only happening in this office.
Error Symptoms
Initially users will typically report that there is an error and when I log into their machine using MS Communicator, 80% of the time it would start working.
I started installing Fiddler on their machines to try and capture more information but 100% of the time I did that, the form started posting successfully. The users being resourceful, simply start Fiddler anytime the form doesn't post and it works fine.
I also asked users to go through Citrix which is hosted in the TX office and the form posts fine.
Error Details
I used OPNET to better monitor the traffic and I found that when user's simply open IE the authentication handshake fails.
Client => Server = 401
Client <= Server = Authentication Token
Client does not respond
When we use fiddler, the handshake is successful.
The error returned by SilverLight was a very generic [HttpWebRequest_WebException_RemoteServer] message.
Question
What would cause the handshake to work sometimes by itself, always with fiddler and CITRIX, and sometimes it doesn't.

Resources