Communicating to a RTD Server in Java instead of Excel - java

I have a RTD plugin that provides an Excel sheet with Real Time Data of prices. However, I want to avoid the Excel link and I would like to directly communicate to the RTD server with a Java program such that I can retrieve data and send it to a database. I have seen examples of doing this in C#, but not in Java yet. Does anyone have a clue on how to set this up?

Related

What to use : Excel VS MySql/MongoDB [Java]

I am going to make a business application for my father to make GST(Goods and Services Tax) filing easier. I have the design ready and I am going to use JavaFX.
The user will enter the data in tableview and that data needs to be stored for future reference.
The tableview needs to be converted to an excel file (gonna use Apache POI). The excel file will be sent to a C.A who will file GST on my father's behalf.
The application will need to import/export data into/from the tableview and edit the data as necessary.
I have 2 options :
Store/retrieve data from MySQL to tableview, update it according to the user's will and later export the data into excel files for sending it to C.A.
Store/retrieve data from excel files to tableview, update it according to the user's will and send the excel file to C.A.
I am planning to expand the application into a complete Business software that can manage entire business.
What should I use?
Which one will be more efficient and why?
I hope I am able to convey my question (I ain't good at writing).
In my own opinion it is more efficient and have more posibilities to explotes the data using MySQL, because reading and writing an Excel file will take a lot of time and it is slower.
I'll answer my own question, since I have got the answer.
I'm going with SQLite for now as using csv or excel files is gonna consume a lot of resources (I tried it).
I am going to sync the .db file in drive using scripts from the application itself. MySQL is definitely better choice but I want to database to be used by 2 computers at a time (not in network) so I will have to pay for online database.
I will store the .db file and drive and will retrieve it whenever the application runs. In this way its going to be safe.

How do I edit Excel Spreadsheet shared over sharepoint.com using java

At my work I have a to keep records of all the supports I have provided to the clients of our company in an Online Excel sheet. Now being a java developer I find this very boring task and it also consumes my time as same data I have to copy paste 2-3 places. Can someone please tell how can I automate this using java.
Attached is the snapshot of my online excel sheet., we call it support tracker.
Under Support_Tracker we have to maintain all the supports we have provided to every project.
Then right to that(SalesForce_issue_tracer, Servicenow_issue_tracker) are the products for which we provide support. Now to these products sheet, I have to copy paste the data from Support_Tracker. I want to automate all this stuuf.
Please tell how can I achieve this.
I google it and found some APIs, one of them is Apache POI, but I am not sure whether I can edit an Online Excel fine using this.
Excel fine is on sharePoint.com.

Adding data in Excel file without closing it

I am currently using Apache POI to enter data into Excel file. The only problem is I can not keep the file open if I have to append data to the same file. Are there any specific sample codes which would allow me to do so?
My basic requirement is to fetch Runtime data from a place (this I am able to do) and add it to the Excel sheet while the file is still open.
Any suggestions?
I don't think that this is possible without a C# addon or some kind of macro. You could write a simple C# addon for Excel that connects to your java programm and recieves the realtime data. The addon will write it to the spreadsheat then.

refreshing an excel sheet via java

I have to build and app that extracts stock exchange data from an excel sheet then save it
in a database. The problem is that the excel sheet obtains new data via a Bloomberg plug in.
To refresh the page, the user has to open the spread sheet and hit the refresh button on the plug in in excel. After a second the data is added to the sheet.
i have seen guides about getting or putting data to an excel sheet via java but am not sure how to open the sheet, trigger the update and get the data.
Maybe you can retrieve the data directly with Excel, by using Web Queries.
So basically, this feature allows you to get data from the web. You specify the URL, then you select which data on the page you want to import.
You can write these queries in VB as well (ask if you want more details on how to do it with VB).
http://office.microsoft.com/
It is not clear what you are trying to achieve. I understand that you only use the spreadsheet to get the data and save it to a database.
There are a few alternatives I can think of:
[dirty] create a scheduled task in Windows that opens the spreadsheet every x minutes / hours. In your workbook, create a Workbook_Open event that uses Application.OnTime to execute a macro to do what you need to do with the data after a few minutes (the time it takes for the data to update). This is error-prone and will probably fail from time to time.
[better] use something similar except that you get the data programmatically with the VBA Addin, populate the sheet from VBA and/or do what you need to do with the data. No need for Application.OnTime in that case. You can even automatically save/close the spreadsheet.
[better] Have your java code get the data and send it to your database. If users need the data in Excel, you can have Excel query the database when required.
Note: with a typical Bloomberg Terminal/Anywhere license, it is not permitted to save data on a different machine so the database would need to be located on the local PC. Other licenses have different terms.
I think you should look into using Bloomberg's API v3 to retrieve the data. You have access to any field which you see in FLDS on the Bloomberg terminal.

Synchronization between Java Application and Microsoft Application via Jacob

In my java application I am connecting to Microsoft Excel with Jacob libraries. Everything is fine but I do not know how I can catch com events when any changes in Excel page occurs by using Jacob libraries. For example, In my project I connect database takes table values and copy these values into cells of an excel page. Whenever a cell value is changed, the table value is also changed. That's I want synchronization between java and Microsoft Excel application by Jacob.
Don't use Java to achieve that. See this question: Excel OnChange event, with emphasis on this answer. You should access your database using com directly from Excel. That's easy using ADO. This ADO tutorial from w3schools looks also fine.
If the task is too complex to perform directly from Excel you may think of putting a small marker somewhere (e.g. in the database) that the data changed and process this marker from other app, possibly java app. The difficulty is that the credentials to access the database must be hardcoded in the Excel sheet. But you can create a separate database user with narrow database permissions.
Seeing your comment I also tried using Change event of Excel to detect changes done by other users. My experience on Excel 2003 shows that this works only locally. That is the event is fired only for the user that made the change. If many users have the worksheet open they don't receive Change event caused by changes from other users. So your approach is unfeasible. You may test it with Excel 2010, but my impression is that the events in general work only locally. Couldn't find anything on the net about it. Only this general article: Track changes in a shared workbook.

Categories