finally... got d temporary solution....... project is resolved..thanks all for yoursupport..
what i did is... i used a java script and related it with the table i wanted to sort..
<%--
Document : index
Created on : Sep 4, 2012, 4:55:31 PM
Author : Sanidhya09
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> Page For List Sorting</title>
</head>
<body>
<%
try {
String connectionURL = "jdbc:mysql://localhost:3308/sanidhya09";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver");
connection = DriverManager.getConnection(connectionURL,"root","");
if(!connection.isClosed())
%>
<font size="+3" color="green">
<%
out.println("Successfully connected to " + "MySQL");
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * from details");
%>
<script type="text/javascript" src="gs_sortable.1.7.js"></script>
<script type="text/javascript">
<!--
var TSort_Data = new Array ('my_table', 'i','s','s');
//tsRegister();
// -->
</script>
<TABLE id="my_table" cellpadding="15" border="1" style="background-color: #ffffcc;" >
<thead>
<%--<a href="#" OnClick=" return <%rs = statement.executeQuery("SELECT * from details order by id, name, address desc;");%>"</a>--%>
<th style="cursor: pointer;"><a href="" onclick="tsDraw(0,'my_table'); return false">ID</a></th>
<%--<%String string = response.encodeURL("");%>--%>
<th style="cursor: pointer;"><a href="" onclick="tsDraw(1,'my_table'); return false">NAME</a></th>
<th style="cursor: pointer;"><a href="" onclick="tsDraw(1,'my_table'); return false">ADDRESS</a></th>
</thead>
<%
while (rs.next()) {
%>
<TR>
<TD><%=rs.getInt(1)%></TD>
<TD><%=rs.getString(2)%></TD>
<TD><%=rs.getString(3)%></TD>
</TR>
<% } %></TABLE>
<%
rs.close();
statement.close();
connection.close();
}
catch(Exception ex){
%>
</font>
<font size="+3" color="red">
<%
out.println("Unable to connect to database" + ex);
}%>
</font>
</body>
</html>