How to read .rpt files and load data to database - java

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.

Related

Upload JAR into database

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.

Storing autocad files in database

I have a client requirement in which I am asked to link autocad files with a table in DB. The file names will be stored in this table. This DB will be in the AWS cloud. The files will be mostly read only and downloaded by customers from the cloud.
Here's what is needed -
Need to show a huge list of equipment's
Each row will show equipment name, description and will show 3 options
Option 1 Download drawing file
Option 2 Download pdf manual for this equipment
Option 3 Download file which contains Unique ID for this equipment
I am not sure how to go about this. My questions to everyone reading this are as follows -
1. Should I be storing autocad files in a DB table or should I keep them in a folder and refer to them as and when needed?
2. If I should be storing it in a DB which database and datatype should I use?
3. Can someone tell me how I should go about implementing this.
Any help is much appreciated.
Thanks
Here is discussion on the pros and cons of storing large files in a db: Is it a bad practice to store large files (10 MB) in a database?.
I would suggest either storing fs locations in the db or using a JCR implementation (example Apache jackrabbit) to manage your files.

How can we populate the CSV data into Mysql database from jenkins

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.

java open a file(pdf,xsl,etc...) from mongo db

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.

Java Unzip each file into Database

I am attempting to write a java application that will unzip an archive and store it in a database.
I would like to insert each file in the database after it has been extracted, does anyone have a good example of a java unzip procedure?
A little google-search would have helped you. Tutorial by Sun.
If you want to store the extracted data in a MySQL-Database you'll want to use a BLOB to do so. Tutorial might be found here.
Notice: BLOBs should not grow bigger then 1M because they'll be slower then a normal file-system. Here is the full article.

Categories

Resources