February 2013

How to display a message dialog on the JSF page

ADF By Feb 06, 2013 No Comments

The below code will be used to display a message dialog on the JSF page.         FacesContext facesContext = FacesContext.getCurrentInstance();         FacesMessage facesMessage = new FacesMessage(message); facesMessage.setSeverity(severity); facesContext.addMessage(null, facesMessage); Where message is the message what we want to display on the dialog box and severity is to show the severity of the message. Example for severity is FacesMessage.SEVERITY_INFO which displays…

Creating GraphDataModel object for pieGraph

ADF By Feb 06, 2013 No Comments

When creating a dvt:pieGraph, an object of GraphDataModel class needs to be passed as input to it. The below code helps to understand how to create GraphDataModel object. In the below code, I am taking data from database.     public static GraphDataModel getGraphDataModel(String table,                                                                                                     String cust_id) throws Exception {        String[] columnLabels = { “” };         String[] columnNames…

Inserting Date and Time in database

SQL By Feb 06, 2013 No Comments

I want to insert date and time into a field of a Oracle table whose data type is “Date”. To do so, I have used the below command. to_date(‘2011/12/12 11:15:00’, ‘yyyy/mm/dd hh24:mi:ss’) Example: Table definition:  create table ATG(local_id varchar2(50) primary key,Last_Sale Date, Last_Sale_Value varchar2(50),Total_12_month_Value  varchar2(50)); In the above table, I want to insert data and time to “Last_Sale field”. Insert…