Initially I assume your table has 2 columns
ID and position !!!
If U use preparedStatement, U define the following, in Java, but I think in
the other programming languages U have PreparedStatements too.
Connection conn;
PreparedStatement pstmt1=conn.prepareStatement("Update Mytable set
position=?+5 where ID=1").
for the next, U prepare the pstmt2, exept position, and ID=2 and so on
Your t (time) is same for all objects?
If U wanna change the t (time) U execute the following.
int t=0
StringBuffer strBuff=new StringBuffer();
strBuff.append("pstmt");
// U use transaction
conn.setAutocommit(false);
for(int i=1;i<maxID;i++){
// next line is for making Strings pstmt1, pstmt2...pstmtmaxID in a
StringBuffer
strBuff.append(Integer.parseInt(i).toString());
String temp=strBuff.toString();
temp.setInt(t);
temp.executeUpdate();
}
conn.setAutocommit(true);
I assume, that t is integer;
You have to include this cicle within a transaction, to have a valid database.
Autocommit=0
I didn't try it, but I hope is it correct
regards
On Thu, 9 Oct 2003 17:56:42 -0700, Stephen Rich wrote
> I have a simulation of moving objects that interact with each other.
> If I store the object positions as coordinates, I think I will need
> at least one database call for every object to determine intersections.
> [for N objects there are N database calls]
>
> I'm wondering if I could do the same thing storing object positions
> as an equation. An equation where if I plug in any point of time t,
> I could determine where the object will be at that time. i.e., for
> y = t + 5 and t = 3 the y position is 8. Is there a way store
> equations with one variable in MySQL such that I could compare them
> for intersections by plugging in values for the variable?
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?
[EMAIL PROTECTED]
Laszlo Illyes
Teaching-assistant
Sapientia University
(Csikszereda) Miercurea-Ciuc
Tel:+40266317310
Fax:+40266317310/+40266371121
Mobil:+40740055706
E-mail: [EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]