Wednesday Nov 22, 2006

Sample Database support in Visual Web Pack for NetBeans 5.5

Visual Web Pack includes a sample database, named Travel

Travel is installed automatically after Java DB is registered in the IDE.
Once Java DB is registered, a restart of the IDE is required.

If the NetBeans userdir is deleted then the same as above applies.

Java DB can be registered by either installing Sun Java System Application Server 9 (Glassfish)
or installing manually.

Java DB (Derby) can be registered by opening Tools->Options - Advanced - IDE Configuration - Server and External Tool Settings - Java DB Database
Here the installation of Derby is specified along with the path where databases are created (default location is $HOME/.netbeans-derby)





Before

After restarting NetBeans, in the Runtime tab there will be a new connection for Travel.





Before

More info:

To use the Travel database in a Visual Web Pack application, in the Runtime tab, open the context menu for the connection
jdbc:derby://localhost:1527/travel [travel on TRAVEL] then choose connect.
A login dialog will open - travel is the password

After the connection is successful, create a new Visual Web Pack project and back in the Runtime tab, expand the Travel connection node, Table
then click on a table and drag and drop the table to the Design view or on top of a JSF component in the Design view.

When a table is dropped, a dataprovider instance is created in the Page1 bean class and a JSF binding expression is generated in the JSP source.
To see bindings, either select a component and the Properties window will reflect the bindings. Alternatively, right-click on the component
and choose Property Bindings context menu.

Note, that when exiting NetBeans, Java DB and SJSAS are shut down. After restarting NetBeans, also
start Java DB, otherwise, the Component Error page will open. If this page opens then start Java DB
then click the Refresh button located at the top of the Design page (the button with 2 squiggly
arrows pointing in opposite directions)





Before

If the tables and or data are lost for Travel, to restore the databases, a SQL script is included.
Choose File->Open and navigate to the installation directory of NetBeans 5.5 and open rave2.0/startup/samples/create-Travel-derby.sql
The SQL editor will open. Then make sure to select the Travel connection from the dropdown in the editor (maximize NetBeans if the dropdown is not
visible) then click the small green arrow adjacent to the connection dropdown. The Travel tables and data will be restored.

Look for VWP tutorials coming soon or see the Creator 2 Tutorials, some are still applicable to the Visual Web Pack.
For more info on Creator 2 to Visual Web Pack, see Winston Prakash's blog

Comments:

buenos dias. no se si sea el espacio indicado pero tengo un problema, realizo los pasos que se dicen en los tutoriales sobre como utilizando el ide vincular una tabla con jsf con un tabla de una base de datos, sim embargo tengo un problemita, cuando ejecuto la aplicacion el servidor me esta dando un error y revisando dice no se puede cargar el Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver' pero no es coherente porque yo utilizo el driver para otras consultas, parece que el ide solo no es capaz de montar solo el datasource o no porfa alguna ayudita, la solucion que he oplanteado es la siguiente pero no me parece adecuada ctrserverRowSet.setDataSourceName("java:comp/env/jdbc/dataSource9"); ctrserverRowSet.setCommand("SELECT ALL dbo.Ctrserver.Nombd, \n dbo.Ctrserver.Indprincipal, \n dbo.Ctrserver.descripcion, \n dbo.Ctrserver.host \nFROM dbo.Ctrserver\nWHERE dbo.Ctrserver.Nombd LIKE ? "); ctrserverRowSet.setObject(1,"%%"); ctrserverRowSet.setTableName("Ctrserver"); ctrserverRowSet.execute(Util.getConexion()); le paso al rowset que me crea el ide netbeans una conexion a mano y funciona pero repito no me parece te agradeceria una ayudita gracias

Posted by jaider fernando rodriguez lozano on December 19, 2006 at 05:12 AM PST #

Hola, me disculpo, yo no escribo buen español. Espero que entiendas el siguiente: ¿qué versión del SQLServerDriver estás utilizando? Debe ser se conforma al estándar de JDBC 3.0. También, en el tiempo de pasada, necesitarás copiar el archivo al servidor del uso. Espero que esto ayude

Posted by John Baker on December 19, 2006 at 11:14 AM PST #

its really v helping! I applause it by heart!

Posted by Sami on August 19, 2009 at 12:31 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed