
Friday May 16, 2008
MySQL and Travel Database
Hi all,
The wheels are turning. Everyday, MySQL is being further integrated in NetBeans. Now you have access to databases formerly associated with Java DB. A good example would be the Travel database. A lot of Visual Web JSF tutorials use this database, and until now, if you wanted to use this database you had to use the Java DB Database Server. Not any more. Now you can use MySQL. I'll show you how.
-
Before you start, make sure you have MySQL installed on your machine. Also, make sure the MySQL server is running. You can check to see if the server is running by expanding the Databases node in the Services window.

- Now it's time to create the database. Right-click the MySQL node and choose Create Database. The Create MySQL Database dialog box opens.

- Select the Travel database from the drop down list and click OK.

- The New Database Connection dialog box opens with the connection information already entered for you. Enter the root password (if you use one) and click OK. You'll also be prompted to choose a schema. Just accept the default and click OK.

- The IDE runs an SQL script to populate the Travel database.

-
The database is now not only created, but it is also connected. How's that for efficiency? If by some chance the database had already been created, and all you needed to do was to connect to it, you'd only have expand Databases > MySQL in the Services window, right-click the Travel database, and choose Connect. It's really that easy.

- Now we're in business. The database is there and connected. If you want to see what it contains, just expand the Travel database connection node in the Services window.

- And to see the actual data, just right-click any table node and choose View Data.

Have fun with MySQL and NetBeans!
Cheers!
--James
Posted by branajam
( May 16 2008, 07:01:15 PM CEST )
Permalink