Java Reference
In-Depth Information
JavaDB is installed in our workstation, therefore the server name to use is
localhost . By default, JavaDB listens to port 1527 , therefore that is the port we
specify in the URL. We wish to connect to a database called jpaintro , therefore
we specify it as the database name. Since the jpaintro database does not exist yet,
we pass the attribute create=true to JavaDB, this attribute is used to create the
database if it doesn't exist yet.
Every JavaDB database contains a schema named APP, since each user by default
uses a schema named after his/her own login name. The easiest way to get going is
to create a user named "APP" and select a password for this user.
Clicking on the Show JDBC URL checkbox reveals the JDBC URL for the connection
we are setting up.
The New Database Connection wizard warns us of potential security
risks when choosing to let NetBeans remember the password for the
database connection. Database passwords are scrambled (but not
encrypted) and stored in an XML file under the .netbeans/[netbeans
version]/config/Databases/Connections directory. If we follow
common security practices such as locking our workstation when we
walk away from it, the risks of having NetBeans remember database
passwords will be minimal.
Once we have created our new data source and connection pool, we can continue
configuring our persistence unit.
 
Search WWH ::




Custom Search