Tuesday May 06, 2008

 

 
When creating Visual JSF projects in NetBeans 6.0 (and 6.1) to connect to and execute database operations from a JSF application a data source is created by dragging and dropping a database table to the Design view and right on top of a JSF component.  This creates a JSF binding to the component.  By default the data source name generated is [schema name]_[database product name].  If you're using MySQL then the table name is used instead of the schema name.  To see the name generated for your database connection, for your project in the Projects window, expand the Data Source References node.


 If you want to choose the data source name generated then an option has been added.  Open the Options dialog from the Tools main menu.  Next click the Miscellaneous icon at the top and then click the Visual Web tab.  Next, check the Prompt for Data Source Name checkbox.  



From now on when you drag and drop a database table onto the Design view, a dialog will open allowing you to enter the name of your liking. 

Note, that no error checking is performed, so names with spaces or non alphanumeric characters won't make good data source names.  It's ok to just choose the default name provided.

 


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed