Exporting Derby Database netbeans 8.1 with web application project - java

I used netbeans' automatic generation of entity classes from database and automatic generation of JSF pages from entity classes to build a simple CRUD web application.
I used glassfish server and java db.
Now I want to move the application to be usable on a usb stick for submission for a one time use.
How could i export/move the project with the data and configuration settings in place so the database will work with the project on another computer?
Any help would be much appreciated.

Related

Upload Spring Project to github account with/without server and how do I embed mysql database

Please I intend to upload a small spring application I built to my git account. It uses tomcat server. What I don't know is that does the convention mandate that I upload my project together with the server or i upload the project alone and a person who intends to view the application downloads it and downloads his/her own server to be able to use the application? Here is an image file structure.
enter image description here
And another issue is this application makes use of a database I created using mySQL workbench. How do I now make this upload together with my database?
Basically if it is a pure Java / Spring application the one using it / downloading it must setup the application server and the database server. If you need any init scripts for your database you can add them to your project (e.g. SQL Scripts).
If you want everything to work out of the box, without requiring one to setup a database server and an application server, you should have a look at spring boot (ships with an embedded tomcat) and may use an embedded database like HSQL or SQLite.
Hope I could help

How can I connect to database hosted in VM for Spring development in STS?

I have to do a spring boot project using gradle, but I am in a confusion whether to use net beans or STS to complete my project. I also don't know how to connect to database hosted on a VM.
The official recommendation for Spring development is Spring Tool Suiteā„¢. You could also download Eclipse IDE and install STS tool as the plugin to it for the same purpose. Choose either ne of the option.
Next step will to set up the development environment. The recommended way to get started, would be to use maven or gradle to manage the dependencies for the project. You could also manually download the .jars, add them to classpath and get started.
To access the database you can use JDBC, any ORM tool like hibernate or Spring Data as per your convinience.
As per the information provided by you, it is clear that you want to set up the database server in a VM. The db server has to be configured correctlty to allow remote IPs to connect to it.
Point here is STS has no business to do with your db server.
STS is just an IDE supporting Spring development. IDE has nothing to do with connecting to your db. You have to write jdbc, orm or similar code to connect to the db.
There are enough materials online to learn these tools and technologies.
All the best...:)
I hope my answer helps you!

database attachement when creating .jar file

I have created a desktop application of shop management system and it is working well (runs on ide) but when I created a jar file of it and run this on another computer then it is not doing anything.
The problem which I figure it out is that the database is not attached with the .jar file.
Can anybody guide me?
Details:
Language : java
IDE: netbeans
Database: mysql server 5.1
First of all Mysql server doesn't support db Embedding feature.
You may consider changing the DBMS If you want to ship your database with the application.
apache derby
h2
and sun's distribution of JavaDB
These will help your current scenario or if you have simple light weight operations, You can use SQLite.

How to access database with Oracle ADF

I'm learning how to use ADF to build a webservice based desktop application.
I already have the code that sync webservice data with local derby database(for cache) from exist project.
Is there anyway to access database directly via ORM/entity or something that ADF generated?
Is creating JPA persistence unit xml files & Toplink sessions a correct way coding with ADF applications?
(Not sure I've understood you correctly)
To create database connection:
Application Navigator -> Application Resources panel
right click on Connections folder -> New connection -> Database...
Then you create Application Module, put Entity Objects there and so on

GWT Web Application project, with Hibernate?

I've made a Google Web Application Project in Eclipse and am now running into problems as I need to use from a server side point of view, with Hibernate with MySQL. I've just been told that Google Web Application projects can't run Hibernate connections to MySQL as they're deployed projects.
What's the best way for me to migrate this project somehow so it runs on say Glassfish and just uses GWT for the client side technologies that can then use Hibernate and MySQL, rather than actually being deployed?
Thanks,
David
You cannot access database from client-side directly.
GWT translates your client-side java code into Javascript which runs in browser; there is no way to directly access JDBC.
You will have to employ server-side which will handle your DB persistence. Your client can communicate via GWT-RPC, JSON, XML, or any other protocol - but the database connection part will always reside on server.
Note that the server part does not need to be in Java - it can use PHP or any other technology, as long as it understands the javascript generated out of your app.

Categories