need help with INSERT method
hi All
I am using JavaBean in order to extract records from database table, using JDBC. I have written a method which allow me retrieve the entire database table. now I want insert a new records into the table (INSERT method) .
can you please give any idea how to do it.
Thanks
[302 byte] By [
sjaliaa] at [2007-11-26 22:10:09]

# 1
You can use indexed properties, for example:
public class Table {
public Record[] getRecords() {
... some JDBC code ...
}
public Record getRecords(int index) {
... some JDBC code ...
}
public void setRecords(int index, Record record) {
... some JDBC code ...
}
}
If you want know how you can use JDBC to insert record into table
go to the Java Database Connectivity forum:
http://forum.java.sun.com/forum.jspa?forumID=48
# 2
hi All
Iam using RMI in order to create an auction, for multiple client to access the server. I just want use an array in order to allow multiple access. Can any body help me with the arrays.
the folowing is my code:
package rmicallback;
import java.util.*;
public class Server
extends java.rmi.server.UnicastRemoteObject
implements Iserver {
String time = new String();
Calendar cal = Calendar.getInstance();
Iclient[] b=
{new Client1("English Auction"),
new Client2("Dutch Auction"),
new Client3("Sample Auction"),
new Client4("None")};
for (int i=0; i<icl.length; i++)
{
}
public Server() throws java.rmi.RemoteException {
super();
}
public void setClientTime(String clientTime)
throws java.rmi.RemoteException {
time = "The client time is " + clientTime;
b.updateTime(time);
}
public void setServerTime()
throws java.rmi.RemoteException {
cal.setTime(new Date());
int hour = cal.get(Calendar.HOUR_OF_DAY);
int minute = cal.get(Calendar.MINUTE);
int secs = cal.get(Calendar.SECOND);
time = "The Server time is " + hour + ":" + minute + "." + secs;
icl.updateTime(time);
}
public void setClient(Iclient c)
throws java.rmi.RemoteException {
b = c;
}
}
Thanks>