java how to parse xml and save data into mysql database [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a question.
I want to parse XML file using SAX or JAXB and save the parsed file into a database using java, any help please.

Even though you should research the topic first, I am giving you a starting point. Basically you'd use unmarshalling to create a java object from an XML (see http://lstierneyltd.com/blog/development/examples/java-to-xml-xml-to-java-marshalling-and-unmarshalling/). Then you could use some i.e. Apache Cayenne or Hibernate to store the object to a database.
I would recommend to refrain from putting the XML to a relational database itself if you expect significant amounts of data.

Related

Convert tables into java entities [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have thousands of table in the database that needs to convert in hibernate java entities.What are the possible ways to do this task?
Use Eclipse Dali Java Persistence Tools refer to this link on how to generate the entities.
I would write a simple Java program to read the database meta data of the tables and column names in the tables. It then could write out a Java class file per each table using the column names for the class variables.
A sample program that reads the DB meta information is here. It could quickly be adapted to reading in the DB tables and writing out the Java classes.
Sample Java DB Meta Data Program
A better set of examples for the generic JDBC Metadata API is here

Can I use a program via java? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
My question is simple:
Is it possible to use a program via Java? Meaning, can I for example code in java exactly what I want my Microsoft Word file do? Add paragraphs, lists,import a picture, etc?
Short answer: Yes. Some programs allow you to use scripts and such, that is the beauty of open source software.
To actually edit the document you can use Apache POI which is an API for Microsoft Documents. Granted it cannot handle .docx but simple text documents. You may also want to take a look at docx4java which supports .docx, .pptx and .xlsx files.

I am trying to generate data from Oracle SQL in excel format Using Java but I can't find a way [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am novice in JAVA and using Oracle SQL 11g, I have a requirement on my JAVA program to export data from Oracle Database in excel format.
I've searching in youtube but i can't find a way.
You can use Apache POI to export data to excel format.
You can use CVS format, witch can be imported in Excel.
1. Select data from DB.
2. Convert DTOs to CVS string.
3. Save them in file.

how to read data from excel and save into database using spring and hibernate [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i have started learning spring, please help me about how to read data from excel and save into database using spring and hibernate, please show me
This question is not related to spring with hibernate.
To read data from excel you need to use a library like Apache POI.
Once you have the data in memory save them to the db using Spring with Hibernate as always (as you already tried with simple examples I hope).
Probably in 80% of the use cases it is possible (and actually easier as no implementation is required) to export the Excel sheet as CSV and import it using common database tools. There are a lot of infos in the internet how to import CSV, e.g. using COPY in Postgres or LOAD DATA in MySQL.

Migrate MS Access to PostgreSQL [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm getting data as an Access file.
My application uses PostgreSQL/Java. I'd like to convert the Access database to PostgreSQL.
can any one help me to code this
I doubt there is any simple automatic method. You will have to create ddl statements to make the tables in postgresql (not sure if you can export ddl from access), export the data from access to a csv, and then use postgresql copy from command to populate the tables.
Or you could consider trying this tool:
http://docman.sourceforge.net/home_html/projects/sql/exportSQL3.txt
but it looks like a dev version, it may not be mature.

Categories

Resources