J
jawwad
Hello;
After a long time l i am able to generate Tree from database using
recursivly..But When the no of messages will becaome greater than 10
,i want to display them on other pages from 10 to onwards.
Can any body please write pseudo code for.Here is code for jsp
tree.(Table Is products(id,pid,lev,name))Hope will be use ful for
others also.Thanks In advance.
<%@ page import="java.util.*,java.sql.*,java.lang.*,oracle.jdbc.driver.*"%>
<%
Statement stmt = null;
String query = "";
Connection conn=null;
try{
//Conection For Datvase
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc
racle:thin
127.0.0.1:1521:ORCL","scott","tiger");
stmt=conn.createStatement();
//Get Top Level IDS For eg c and d drive
ResultSet RS=stmt.executeQuery("Select id from products where pid=0");
Vector vpid=new Vector();
while(RS.next())
vpid.add(new Integer(RS.getInt("id")));//Put it into vector
//Now Select all ids which have childerens
RS=stmt.executeQuery("Select distinct pid from products where
pid!=0");
Vector allpid=new Vector();
//Put In The Vector
while(RS.next())
allpid.add(new Integer(RS.getInt("pid")));
Iterator i=vpid.iterator();
//Iterate Over Root Ids
while(i.hasNext()){
Integer toppid=(Integer)i.next();
method(toppid.intValue(),allpid,stmt,out);
After a long time l i am able to generate Tree from database using
recursivly..But When the no of messages will becaome greater than 10
,i want to display them on other pages from 10 to onwards.
Can any body please write pseudo code for.Here is code for jsp
tree.(Table Is products(id,pid,lev,name))Hope will be use ful for
others also.Thanks In advance.
<%@ page import="java.util.*,java.sql.*,java.lang.*,oracle.jdbc.driver.*"%>
<%
Statement stmt = null;
String query = "";
Connection conn=null;
try{
//Conection For Datvase
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc
stmt=conn.createStatement();
//Get Top Level IDS For eg c and d drive
ResultSet RS=stmt.executeQuery("Select id from products where pid=0");
Vector vpid=new Vector();
while(RS.next())
vpid.add(new Integer(RS.getInt("id")));//Put it into vector
//Now Select all ids which have childerens
RS=stmt.executeQuery("Select distinct pid from products where
pid!=0");
Vector allpid=new Vector();
//Put In The Vector
while(RS.next())
allpid.add(new Integer(RS.getInt("pid")));
Iterator i=vpid.iterator();
//Iterate Over Root Ids
while(i.hasNext()){
Integer toppid=(Integer)i.next();
method(toppid.intValue(),allpid,stmt,out);