2011/05/17

Webcenter: Build and use Taskflows from Data Controls

In Enterprise 2.0 applications is important to have a flexible and customizable screens that make easy the navigation and the interaction for users. So with Oracle Webcenter Suite 11g you are able to create new Business Mashups easily and will help you to show graphical information, interact with a database, ...

In the example below, we are adding the two kinds of mashups to a Webcenter Spaces page. The first one is a SQL Data Control that will fetch data from a database table and the second one is a webservice deployed on the Weblogic application server that will insert data from the Webcenter page to the same database table.

Note: You can follow this guide to deploy a new Webservice

Once the mashups are added, the video is showing how to test it and checking it by connecting to the database through sqlplus.

2011/05/02

jDeveloper: Create and deploy a Java Webservice

This tutorial shows how to create a simple Java Webservice using the Oracle jDeveloper 11g IDE. The attached code for the example connects to a database through JDBC and executes a SQL statement to insert a new row in a specific table.

Once the application has been configured, it will be deployed and tested in a Oracle Weblogic Server. We will execute the webservice through a web browser and check it by connecting to the database with a sqlplus console.

Step-by-step:
1) Create a generic java application and add the webservice component

2) Create a new java class and add some methods to publish. Here you have an example:
NOTE: Remember to adapt this code to your requirements.

public void InsertValue(String user, String value){
try{
//Example from http://studentsatoracle.blogspot.com
Connection con=null;
Class.forName("oracle.jdbc.driver.OracleDriver");

//Configure the jdbc connection: jdbc:oracle:thin:@host:port:SID,username,passwd
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:owcdb01", "DEV_WEBCENTER","welcome1");
Statement s = con.createStatement();
//Configure the SQL query as you want, the table must exists
s.execute("INSERT INTO DEV_WEBCENTER.uservalues (ID,USERNAME,INSERTDATE,VALUE) VALUES (DEV_WEBCENTER.uservalues_seq.nextval,'"+user+"',To_char(SYSDATE),"+value+")");
s.close();
con.close();
}catch(Exception e){
System.out.println("ERROR: "+e.getMessage());
}
}


3) Configure the webservice and publish the desired methods

4) Deploy the application. You can follow this guide to create a deployment profile: http://studentsatoracle.blogspot.com/2011/02/jdeveloper-how-to-deploy-application-to.html

5) Open a Weblogic Server console and test the application

Documentation:
Oracle's official documentation for jDeveloper 11g

Downloads:
Oracle jDeveloper 11g

Viewlet:
(Duration: 3 min.)