Able To generate Tree But Cant No Of pages Urgent Help Please

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:eek:racle:thin:mad: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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top