Refreshing the page by java mehtod in Oracle ADF

In Oracle ADF, for refreshing the page after doing some operation in database we need to refresh the Page ,which is very needed to display the right content.For this we need to write java method in page.java file. Write that method anywhere in java file and call that method anywhere where you want to refresh the page.

protected void refreshPage() {
      FacesContext fc = FacesContext.getCurrentInstance();
      String refreshpage = fc.getViewRoot().getViewId();
 ViewHandler ViewH =                                                                                                                   
 fc.getApplication().getViewHandler();
      UIViewRoot UIV = ViewH.createView(fc refreshpage);
      UIV.setViewId(refreshpage);
      fc.setViewRoot(UIV);
}

This is only method you need to write to refresh the page.

Query to get a particular row in Sql Server 2005

In this article we will look into how to write a sql query to get a particular row in sql.

Lets write the code to find 2nd row in a table named mcc_measures.

So first we declare a temporary table

declare @temp table (id int) 

No in this temp table we insertrow numbers of the table

insert into @temp(id)

SELECT 
ROW_NUMBER() over(ORDER BY Measure_Id DESC)
FROM 
mcc_measures

Now from the temp table we select the row where rowid=2 as required

SELECT
*
FROM
@temp
WHERE
id = 2

kick it on DotNetKicks.com

Shout it

pimp it

Twitter from ASP.NET Application

twitter
This post will throw a light on how we can update our status on Twitter from an asp.net application.

The task is pretty simple as we have libraries already available on the net.

I will be using twitterizer dll to perform the task.

The following are the steps to be followed:

  1. Download the twitterizer dll from here.
  2. Add the reference to the dll in your asp.net web application.
  3. Write the code. For example
    Twitter t = new Twitter(UserName, Password);
    t.Status.Update(UpdateString);

Following are the methods and the capabilities provided by these methods which are present in the library:

User Methods

  1. Followers
  2. Friends
  3. Follow User

Status Methods

  1. User Timeline
  2. Public Timeline
  3. Friends Timeline
  4. Show
  5. Update
  6. Destroy
  7. Replies

Direct Messages

  1. Sent To User
  2. Sent From User
  3. New Direct Message

References: Twitteriser Home Page

kick it on DotNetKicks.com

Shout it

pimp it