about table

public String User_Tampil()

{

try{

Class.forName("oracle.jdbc.driver.OracleDriver");

koneksi = DriverManager.getConnection(url,user,psd);

state = koneksi.createStatement();

hasil = state.executeQuery("select * from TBL_USER");

while(hasil.next()){

dnama = hasil.getString("USERNAME");

dpsw = hasil.getString("PASSWORD");

doutlet = hasil.getString("OUTLETID");

dlevel = hasil.getString("LEVEL_USER");

//r= new String("<tr><td>"+dno+"</td><td>"+dnama+"</td><td>"+dskor+"</td></tr>");

output+=new String("<tr><td>"+dnama+"</td><td>"+dpsw+"</td><td>"+doutlet+"</td><td>"+dlevel+"</td></tr>");

}

}catch(ClassNotFoundException f)

{

f.printStackTrace();

}

catch(SQLException e)

{

e.printStackTrace();

}

finally

{

try

{

if(hasil !=null) hasil.close();

if(state!=null) state.close();

if(koneksi !=null) koneksi.close();

}

catch(SQLException e)

{

e.printStackTrace();

}

}

return output;

}

that my code about show table from database

and that problem

how i show table but not full if i call my code in up again

that table show next

for example

this table i won to show

no | name |address | telp

1susianother-

2fery another-

. . ..

. . .

100mery another 348

and if coll again secound

no | name |address | telp

101susianother-

102fery another-

. . ..

. . .

200mery another 348

how like that

[2995 byte] By [ba12yua] at [2007-11-26 13:00:07]
# 1

output+=new String("<tr><td>"+dnama+"</td><td>"+dpsw+"</td><td>"+doutlet+"</td><td>"+dlevel+"</td></tr>");

I think you never "reset" output so with the += operation you just add the new strings.

RobinMa at 2007-7-7 17:00:03 > top of Java-index,Java Essentials,Java Programming...