Developing Web Application using NetBeans6.0 and Web Stack on SXDE 01/08
The Solaris Express Developer Edition 1/08 (SXDE 01/08) comes with
NetBeans 6.0 IDE . Also, since SXDE 01/08 also offers the Web Stack as
part of the install it is more inviting for developers to consider it
their platform of choice. The Web Stack is compromised of the AMP
(Apache, MySQL, and PHP) a collection of open source software to build
and deploy web applications on Solaris. You do not need to download
these separately. Now you can use NetBeans6.0 with the Web Stack . The
neat feature is you can access all the applications from the Launch
menu, including NetBeans.
Below I am describing how to develop a Web Application using the Web Stack with NetBeans 6.0 . To keep it simple, I am using the NetBeans tutorial Creating a Simple Web Application in NetBeans Using MySQL . The following software is required for this tutorial. Since you are working on SXDE 01/08, you do not need to install any of it. The beauty of SXDE 01/08 is that it all comes with it.
- NetBeans IDE 6.0 (Part of SXDE 01/08)
- Java SE Development Kit (JDK™) version 6.0
- MySQL database (Part of the Web Stack)
- JDBC Driver for MySQL (Part of NetBeans 6.0)
- Tomcat 6.0 (Part the Web Stack)
Before you get started , you need to create a local user on your system. This will not work with a remote user login. Once you have the SXDE 01/08 installed and a local user created, you can login as the local user. Below are the steps required to make the tutorial work with the Web Stack.
Initialize the Development Environment
For this you need the root password, so be prepared with the password information. To Initialize your Web Application Development environment, click on the Launch menu, and
select All Applications > Developer Tools > Web Stack Admin > Initialize. Once you have initialized the development Environment, now you can view the complete Web Stack menu.
Start the Apache2/MySQLservers
To do this click on the
Launch menu, and select All Applications > Developer Tools > Web Stack Admin
> Start Apache2/MySQL Servers.
Registering the Web Stack Tomcat Server with the IDE
To do this, in the IDE, go to Services Tab -> Servers. Right click and choose Add Server . From the server list choose Tomcat 6.0 . Make sure to enter the path to the tomcat server. See the screen shot below for all the fields.

Preparing the Database in NetBeans IDE: For this section of the tutorial, follow steps as per below.
1)Run the mysql client and create MyNewDatabase as below.# /usr/mysql/5.0/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.45 Source distribution
mysql> create database MyNewDatabase;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| MyNewDatabase |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
2) Connecting to MySQL database in the NetBeans IDE. Go to the Services tab. Right click on DataBases node , and select New Connection. In the New Connection window enter the parameters as shown in the screen shot below:
3) Create the tables. I used the SQL editor in NetBeans to create the tables. To do this in the Database explorer, right-click the Tables node beneath the MyNewDatabase connection node and choose Execute Command. A blank canvas opens in the SQL Editor in the main window.In the SQL Editor, just copy and paste the code from ifpwafcad.sql. file (this is in the original tutorial). Then run the query from the SQL Editor menu. Refresh the MyNewDatabase connection and you can now view the tables by expanding the tables node.

Setting up a JDBC Connection Pool: In this step, if you do not have the Tomcat administration tool installed you can edit the Tomcat's server.xml file. You can access this file from within the IDE from the Services tab. Expand the Servers -> Tomcat6.0 and right click and choose Edit server.xml. Add the following to the server.xml:
<Context path="/IFPWAFCAD" docBase="IFPWAFCAD" debug="5"
reloadable="true" crossContext="true">
<Resource name="jdbc/connectionPool" auth="Container"
type="javax.sql.DataSource" removeAbandoned="true"
removeAbandonedTimeout="30" maxActive="4"
maxIdle="2" maxWait="5000" username="root"
password=""
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/MyNewDatabase"/>
</Context>
That's it ! Now simply follow the tutorial as is. Below are some links to Solaris Express Developer Edition.
Solaris Express Developer Edition Home Page

good
Posted by amin on February 14, 2008 at 03:15 AM PST #
nice
Posted by 122.167.63.101 on February 14, 2008 at 03:16 AM PST #
Interesting. Waiting for my SXDE DVD to arrive to dive into that. :)
Posted by kawazu on February 18, 2008 at 06:18 AM PST #
thanks for sending msg.can u plz send one java project using gui or character.project related to any of kind like games , software , compiler and so on.once again thanks
Posted by amins on February 19, 2008 at 03:04 AM PST #
good
Posted by amins on February 19, 2008 at 03:05 AM PST #
For Solaris Express Developer Edition 1/08 DVD information : See http://developers.sun.com/sxde/download.jsp
Posted by radhika on February 19, 2008 at 10:09 AM PST #
If you are looking for tutorials and/or samples of Java applications in NetBeans, check the following:
http://www.netbeans.org/kb/index.html
http://www.netbeans.org/kb/samples/index.html
Posted by radhika on February 19, 2008 at 10:15 AM PST #
In my Netbeans 5.5,bundled apache-tomcat was placed in enterprise3 folder. In netbeans 6.0, when I try using add server tab to add bundled apache-tomcat6.0.14, I don't find it in enterprise4 and adding the tomcat outside the netbeans gives error. Please let me know how to add bundled apache tomcat-6.0.14 into the server
Posted by Priya on March 26, 2008 at 11:26 PM PDT #
Good!!!
Am kind of new 2 java, i can designed the interface GUI the thing lack is how 2 connect the screens "GUI forms" to the database,e.g. when you write in a users information using the screens ,it must save the infomation 2 mysql dataase.
Could you please help me step by step
Posted by William on March 27, 2008 at 10:18 AM PDT #
I AM INTERESTED IN JAVA USING NETBEANS PLEASE SEND ME NEWLETTERS IF POSSIBLE
Posted by sixbert on April 10, 2008 at 11:11 AM PDT #
Priya:
- In NB6.0, tomcat is not automatically selected during installation.
From http://www.nabble.com/NB-6.0-Bundled-appendages-td14294658.html#a14294712 :
...In installation beginning, press custom button and select tomcat....
So, one option you have is to run the installer again and install tomcat (or do an uninstall and reinstall and select tomcat during reinstall...)
- You can also connect to external tomcat servers. Please take a look at the following FAQs:
http://wiki.netbeans.org/AddExternalTomcat
http://wiki.netbeans.org/DeploymentOnExternalTomcatforNB6
William:
Can you take a look at the following tutorials and see if they help?
http://www.netbeans.org/kb/articles/mysql-client.html
http://www.netbeans.org/kb/articles/mysql.html
http://www.netbeans.org/kb/60/web/mysql-webapp.html
http://www.netbeans.org/kb/60/java/gui-db.html
sixbert:
You can subscribe to the NetBeans newsletter at:
http://www.netbeans.org/community/news/newsletter/index.html
You may also want to check out http://www.netbeans.org/community/ (which provides links to various resources available to NetBeans community members).
Posted by Karthik on April 13, 2008 at 04:08 PM PDT #