Export and import data from parse server - java

I am trying to export and import my database from parse server into / from to xls and csv files. I am using bitnami Parse server with dashboard 1.0.25. Where ever i search it either states Parse has been closed or this functionality is not there on parse server. My question is is there any way to do it without of much hassle thank you and should i keep on using Parse server as it is open source or switch to another as mentioned on many website that many developers are moving to other databases such as mongodb or Firebase etc.
Thank you for your replies.

just call the data from server in your model and export it locally. Why you want to export files on server.

In the shell use mongodump or psql yourdatabasename < db.psql in case of postgres.

Related

Java - Best way to send or upload and retrieve files to a server within a network?

I'm currently developing a Tracking System with JavaFX and MySQL as database that is kept in a server. My application is used within a network and allows users to upload and download pictures and several types of document.
My question: What is the best way to send and retrieve files to a server within a network? And should I store those files in MySQL or just their paths in MySQL? If only files' paths, do I need FTP or other techniques? I need detail answer because it is my first time to develop such application.
Edit: I want to store data in a server. I build this application for client machines so that clients can keep documents in the server and they can access their files from any machines... I have no idea for how to transfer files from client machines to server. Please help me!
You should use socket programming like what is at following link:
http://www.rgagnon.com/javadetails/java-0542.html
.But if you are using Java7, Files is the best one instead of BufferedInputStream or FileInputStream (No extra library require):
/* You can get Path from file also: file.toPath() */
Files.copy(InputStream in, Path target)
Files.copy(Path source, OutputStream out)

how to update server DataBase from android using java

I want to insert data in MySQL using java class file.
I know how to update by calling the .php file using HTTP.
But want I want to know is it possible to to same using java class file on server side .
Lets say I have a java application on server side which is using MySQL database to show a records .
Know I want to update database from android without calling php file but to call java class file.
Thanks in advance
For updating the server database you should use Servlet in Java and for updating the db call the Servlet

How do I recreate db and import JIRA data from previous automated export

I have my own local instance of Atlassian JIRA Issue Server on a hosted server. Unfortunately the hard-drive failed on the hosted server the administrator replaced the drive and recovered the program and data directories, but unfortunately the adminstrator had not actually made a back up of the database :(
Luckily it seems that JIRA automatically does a data export of the data, i have daily zip files such as 2015-Apr-20--0555.zip in
atlassian/application-data/jira/export
But what is the easiest way to import this data ?
The server is starting up but I can't access any admin pages, how do I go about recreating the database (i dont remember any details of how I did this the first time). Should I reinstall jira from scratch or can I fix the existing installation to accept the export file.
if the data exported as SQL then you can easy use MYSQLAdmin to import the data to the New JIRA Database, but if the data is comma separated file then you can use MYSQL command for that, based on what you say you cant do that because you cant reach to the server command windows, then you can create simple PHP file to insert the data from the zip file to the DB this link may help you
http://coyotelab.org/php/upload-csv-and-insert-into-database-using-phpmysql.html

copy table from teradata to mysql

i have searched for hours with no real solution.
I want to setup an ongoing task (everynight). I have a table in a Teradata database on server 1. Everynight i need to copy an entire table from this teradata instance to my development server (server 2) that has MySQL 5.6.
How do i copy an entire table form server 1 to server 2?
Things i have tried:
1)Select all data from table x into ResultSet from teradata server 1. Insert into mysql via preparedStatement. But this is crazy slow. Also i am not sure how to Drop the table and recreate it each night with the schema from the teradata server.
Any help please?
There are a few ways you can do this.
Note: these may be older methods just trying to get you to thinking about how you can do this in your current environment. Plus I am not familiar with your data sensitivity and permissions, etc.
One would be teradata to MySQL via CSV file see the examples and links below. (these could be older posts but the basic ideas are what you need).
Export from teradata:
CREATE EXTERNAL TABLE
database_name.table_name (to be created) SAMEAS database_name.table_name (already existing, whose data is to be exported)
USING (DATAOBJECT ('C:\Data\file_name.csv')
DELIMITER '|' REMOTESOURCE 'ODBC');
Export From Teradata Table to CSV
Edit: If CREATE EXTERNAL TABLE doesn't fly then you may have to use java to extract first and then organize the data...Mimic the current method (however it works) at getting the data. Google-fu with this handy link https://www.google.com/search?q=external+csv+file+teradata&oq=external+csv+file+teradata&
(dnoeth) below recommends this: TPT Export in DELIMITED format (which looks like a hassle...but could be the only way) So here is a link that discusses it: http://developer.teradata.com/tools/articles/external-data-formats-supported-by-the-tpt-dataconnector-operator
Import to mysql (don't drop the table.just delete from table):
mysqlimport --ignore-lines=1 \
--fields-terminated-by=, \
--local -u root \
-p Database \
TableName.csv
http://chriseiffel.com/everything-linux/how-to-import-a-large-csv-file-to-mysql/
You would need to schedule this in both the environments and that could be a huge hassle.
Now I see you use Java and in Java you could create a simple scheduled task via (whatever you have available for scheduling tasks). It is possible that you will have to do trial and error runs and your data could be an issue depending on what it is. How it is delimited, if it has headers, etc.
Then you would call variants of the examples above. Through Java
here is a java example:
http://www.java-tips.org/other-api-tips/jdbc/import-data-from-txt-or-csv-files-into-mysql-database-t-3.html
and another:
How to uploading multiple csv file into mysql database using jsp and servlet?
another:
http://www.csvreader.com/java_csv_samples.php
So the basic idea is exporting your csv from teradata which should be simple.
Using Java to traverse the file server to get your file (you may need to FTP somewhere) you may need to consider this....
Consume your CSV file using Java and either a UDF or some package that can iterate over your CSV (stuff) and import into MySQL (write one yourself or find one on the "internet of things" as they now call it).
Edit: Here is info on scheduling tasks with java and links to review.
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ScheduledExecutorService.html
and check this SO convo...
How to schedule a periodic task in Java?

How can i Get back source data of data contained in a script PHP with Java

I explain, I tried to open my database .sqlite contained in my server in Java with jdbc:sqlite:mydb, but it doesn't work because my database ".sqlite" is distant so i creat a script php based on my server which gets back me all of my databases.
So my question How can i Get back source data of data contained in a script PHP with Java?
Thanks a lot!
PS : Sorry for my english (I'm french)
One way would be to create a service in PHP which offers the data, so that your Java application can consume it.
E.g. PHP can expose the data in an XML or JSON format, for instance over HTTP. Your Java application would then call the HTTP URL and receive the data in JSON/XML/whatever, and then parse it to extract the data from that format.
There are other ways as well, e.g. a service bus could broker the data between the different systems, but that requires much more setup (though in the long run, it does have value, if you keep adding data that you want to expose to more and more systems).
You can create PHP WebService server and write some functions to operate that databases data for fixing your problems. Then just use Java to connect with soap to your created WebService functions.
How to start webservice, try to read this one:
http://greatgandhi.wordpress.com/2009/11/25/create-a-php-webservice-in-5min-using-php-soap-and-wsdl-technology-nusoap/
Its the best way i know, if you need to send some data back to your remote db. Its a little more complicated, but much more correct way to operate remote data.

Categories