jump to navigation

Scheduling a task in java August 22, 2006

Posted by maxmil in : Java,websphere , 1 comment so far

Given the lack of an automatic task scheduler in Websphere and the unavailibilty of cron or other task schedulers in our production server i’ve been looking for a pure java solution.
And… sure enough java has its own scheduling framework. Check this article:

http://www-128.ibm.com/developerworks/java/library/j-schedule.html

Instalation Websphere 5.0 July 7, 2006

Posted by maxmil in : websphere , add a comment

http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tins_epinst.html

Configure jndi datasource May 5, 2006

Posted by maxmil in : websphere , add a comment

**NOTE: MUY IMPORTANTE REINICIAR SERVIDOR 

From the admin console

Create the JDBC provider

The following procedure describes how to create the JDBC provider.

1. Select Resources icon: forward arrow JDBC Providers.
2. Click New.
3. For JDBC Providers, select Oracle JDBC Driver from the drop-down list.
4. Click OK and enter values in the Configuration tab.
* Name (for example, mcsJDBC) If you use a name other than mcsJDBC, use your JDBC provider name in place of mcsJDBC later in this procedure.
* Description (for example, JDBC provider for Multi-Channel Server database).
* Classpath /classes12.zip where is the directory path to classes12.zip on your WebSphere Portal server.
Note: ${ORACLE_JDBC_DRIVER_PATH}/classes12.zip is the default value for the Classpath property. Either replace this value with /classes12.zip or Use Enviroment icon: forward arrow Manage WebSphere Variables to set the ORACLE_JDBC_DRIVER_PATH variable if it is not already set. If a value is not specified for the ORACLE_JDBC_DRIVER_PATH variable, set it to . The variable name represents the directory path to classes12.zip on your WebSphere Portal server.
5. Click OK.
6. Select the JDBC provider that you just created (for example, mcsJDBC).
7. Click Data Sources (under Additional Properties).
8. Click New and enter values in the Configuration tab.
* Name (for example, mcsDS) If you use a name other than mcsDS, use your datasource name in place of mcsDS later in this procedure.
* JNDI Name jdbc/mcsDS (Start the JNDI name with jdbc/.) If you use a JNDI name other than jdbc/mcsDS, use your JNDI name in place of jdbc/mcsDS later in this procedure.
* Description (for example, Multi-Channel Server data source)
9. Select the previously created J2C entry from the Component-managed Authentication Alias drop-down list (for example, mcsDBauth).
10. Click OK.
11. Select the data source you just created (for example, mcsDS).
12. Click Custom Properties (under Additional Properties).
13. Click the URL link.
14. In the Value field, enter the path to the Multi-Channel Server database

jdbc:oracle:thin:@:1521:

where is the Oracle SID you created for the Multi-Channel Server database (for example, mcs).
15. Click OK.
16. Save the configuration.
17. Use the following commands to restart the server1 application server:

/bin/stopServer.sh server1
/bin/startServer.sh server1

Note: For information regarding directory path variables, refer to Variable names used in the Information Center for user supplied information.
18. Log in to the WebSphere Administrative Console.
19. Select Resources icon: forward arrow JDBC Providers icon: forward arrow mcsJDBC icon: forward arrow Data Sources.
20. Select the mcsDS check box and click Test Connection.
Note: If the test connection fails and you modify the configuration, you must restart the server1 application server before testing the connection again.

From the application code 

Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/mcsDSC");
conn = ds.getConnection("user", "password");

Note: 

This leaves messages in the log. To avoid this an alias must be defined: http://www.webspherepower.com/issues/issue200410/00001357002.html