I'm running some tests in Jenkins which will produce CSV report files. So, I need to store the CSV results into Mysql database to query them for my future use. Any of you have any idea that how we can save the CSV data into a database from Jenkins. Is there any plugin for that? If it is not possible with Jenkins can we do that through any java program to pick up a CSV file from a particular location and parse the results to a database which can be run or build using Jenkins I searched throughout the internet but couldn't find anything. Please help me with this. Thanks in advance.
Related
Is it possible to upload jar as a file into database ? I need to upload jars into mongodb. I don't know how to do that. I know about file upload with Spring Boot.
I know it is possible to upload zip in database. But not finding information about JAR/WAR files.
JAR and WAR files are nothing more than a renamed ZIP file. If you want to see it yourself rename something.jar to something.zip and open it using archive manager.
Since you said you know how to upload a ZIP you should follow the same procedure. If the file is small (e.g. less than 4MB) perhaps using BSON is the best approach. See Storing Large Objects and Files in MongoDB.
If you mean saving a jar file into a database - it is depends on the database's support of BLOB data types.
And if you mean use Java language based stored procedures from JAR file - with Oracle and PostgreSQL this is possible. MongoDB supports server side JavaScript stored procedures only.
i am trying to upload files to azure blob, i have referred this code for the same.
and i am able to successfully upload files too, my problem is..
using this code i have to upload files one by one and i am getting more than one files at a time so each time i need to iterate over the list and pass files one by one
what i want to do is to upload all files to azure blob in one go.
i tried searching on internet but unable to find any way :(
please help
Not relevant to Java, but you may check out the AzCopy tool which might be useful to you. It supports uploading blobs in parallel.
http://blogs.msdn.com/b/windowsazurestorage/archive/2012/12/03/azcopy-uploading-downloading-files-for-windows-azure-blobs.aspx
http://blogs.msdn.com/b/windowsazurestorage/archive/2013/09/07/azcopy-transfer-data-with-re-startable-mode-and-sas-token.aspx
I have files(pdf,doc,txt,xsl,etc..) stored in my mongo *db*. I want to retrieve and open them. I know to extract. Also I found out that Desktop.getDesktop().open(FileName); will open the file with its respective application(Acrobat reader, office suite etc). But can anyone please tell me if only the file would be enough or we should give the full path for the file.
In the latter case, can anyone plesae tell me how I could path for the file which is being retrieved from mongodb?
You'll have to extract the file from Mongodb if you want to open it using Desktop.getDesktop().open(FileName);
You can create a temp file using File.createTempFile and write in it the content fetched from mongodb, with the correct file extension, and then run Desktop.getDesktop().open() to open it.
I need to read .rpt files and load the data into MySQL or Oracle using Java.
Can anyone help in this?
As far as i know, .rpt files are used by BIRT.
Are the .rpt (report) files processed in any way or do you just have to write them into a database?
In case of the latter, the necessary steps are:
Create a list of all .rpt files
For each of the files:
Read the file into a String
CREATE a SQL INSERT statement and execute it against your database
Profit.
I will expand this answer if you clarify your requirements.
I am having a database in .dbf (FoxPro) format.
How to retrieve data from FoxPro using Java?
If the data can be migrated to MySQL, How to do the conversion?
Taking the data to intermediate formats seems flawed as there are limitation with memo fields and CSV or Excel files.
If you are interested in a more direct approach you could consider something like "VFP2MySQL Data Upload program" or "Stru2MySQL_2", both written by Visual FoxPro developers. Search for them on this download page:
http://leafe.com/dls/vfp
DB-Convert (http://dbconvert.com/convert-foxpro-to-mysql-sync.php) is a commercial product that you might find helpful.
Rick Schummer, VFP MVP
You can use XBaseJ to access (and even modify write) data from FoxPro databases directly from Java with simple API.
This would allow you to have the two applications (the old FoxPro and the new Java one) side by side by constantly synchronizing the data until the new application is ready to replace the old one (e.g. many times the customers still hang on and trust more their old application for a while).
Do you have a copy of FoxPro? You can save the database as an HTML file, if you want. Then, from HTML, you can save to any format you want. I recently did this to save a FoxPro table as an Excel spreadsheet (not that I'd suggest using that for your Java code).
If you plan on using Java, once you have access to the data, why not use one of Java's native storage types?
I worked on the same project once long back where the project had be done with FoxPro and then we migrated that project to Java with MySQL.
We had the data in Excel sheets or .txt files, so we created tables as exact replica of the FoxPro data and transferred the data from the Excel/CSV /txt to MySQL using the Import data feature.
Once we did this, I think further you can take care from MySQL Data.
But remember work will take some time, and we need to be patient.
I suppose doing a CSV export of your FoxPro data and then writing a little Java programme that takes the CSV as input is your best bet. Writing a programme that both connects to FoxPro and MySQL in Java is needlessly complicated, you are doing a one time migration.
By the way PHP could do an excellent job at inserting the data into MySQL too. The main thing is that you get your data in the MySQL schema, so you can use it with your new application (which I assume is in Java.)
Two steps: DBF => CSV and the CSV => MySQL.
To convert DBF(Foxpro tables) to CSV the below link helps a lot
http://1stopit.blogspot.com/2009/06/dbf-to-mysql-conversion-on-windows.html
CSV => MySQL
MySQL itself supports CSV import option (or) to read csv file this link helps
http://www.csvreader.com/java_csv.php
I read the CSV file using Java CsvReader and inserted the records through program. For that i used PreparedSatement with Batch the below link gives samples for that
http://www.codeweblog.com/switch-to-jdbc-oracle-many-data-insert/