Sunday Nov 26, 2006

To rename a data source and JNDI name. The Data Source created in Visual Web Pack (VWP) corresponds to
the JNDI setting on the application server:

Tomcat workaround
Glassfish workaround


Tomcat workaround
(Workaround provided by a Customer, much appreciated)

How to rename a datasource to Ciyela.

1. Define the connection in Runtime > database > New Connection.
2. Stop IDE.
3. Edit context.xml, change


from:
<object name="dataSource" class="com.sun.rave.sql.DesignTimeDataSource">
To:
<object name="Ciyela" class="com.sun.rave.sql.DesignTimeDataSource">

4. Restart IDE and add the reference to the project.

At this point I can add RowSets and providers but VWP don't deploy
connection, just adds the resource reference. The steps to run the
application on bundled Tomcat are:

1. Stop Tomcat.
2. Edit the "ide" user password in $USER_HOME/.netbeans/5.5/apache-tomcat-5.5.17_base/conf/tomcat-users.xml
3. Edit the password used by IDE to connect to Tomcat: Runtime > Servers > Bundled Tomcat > Properties > Connection > Password.
4. Copy database's jar (Firebird in my case) to $NET_BEANS_HOME/enterprise3/apache-tomcat-5.5.17/common/lib
5. Start Tomcat.
6. Open admin console: Runtime > Servers > Bundled Tomcat > View Admin Console.
7. Define the data source.
8. Run the application.


Glassfish workaround
1) Switch to the Runtime tab, expand the Servers and delete the JDBC Resources and Connection pools.

sjsas_resources.GIF

(Steps 2-5 below apply to a single project and must be done for each project
that is to use a new JNDI name)

2) In the project's directory, edit SessionBean1.java and rename the data source name in the _init() method

e.g. edit

tripRowSet.setDataSourceName("java:comp/env/jdbc/cpsDataSource");

3) Open the

setup/jdbc_dataSource.sun-resource 
file and change the JNDI setting

4) Edit

web/WEB-INF/web.xml 
and change the setting

5) Edit

web/WEB-INF/sun-web.xml 
and change the and settings

6) Choose Help->About - Detail to find the User Dir setting

7) In a text editor, open context.xml (located in the User Dir) and change the name set in the

object name ... 
setting

8) In a text editor, open var/attributes.xml (located in the User Dir) and change the
attr name="datasource-names" stringvalue= ... setting

9) Start IDE, then for the project (set as the Main project) choose Build->Clean and Build Main Project

10) Redeploy the application

Comments:

do I set the Jboss database workaround like that in Tomcat workaround ? thank you!

Posted by gomygo on March 27, 2007 at 12:14 AM PDT #

how to input the data provider in the each table of database before apply the bind activity.thank you

Posted by uyin on March 28, 2007 at 03:48 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed