Thursday, March 31, 2005

Finish the transaction

12.36

Display the foreign account information correctly, but the information about the HKD lost. The Tomcat report that the error occur in the SQL statement. Again, in the line 167:getRate() and line 199:doBuy(), 268:doGet(). Invalid column 'Buy'

Solution.1 change 'Buy' --> 'buyRate'

12.58

Display correctly with the foreign dollar and the hkd with the correct buying rate(in the console environment.)

15.38

Something may need to change in the transaction record table as the datetime attribute of the column traqns_date is in type:datetime

16.15

Some error occur as the return boolean value is incorrectly represented.

17:15

find a big problem when updating the database and accessing it complicated steps

    • use the Update command

    • update TABLE set COLUMN where CONDITIONS

17.17

Update the record in term of string to money n the hkd account/

    • 'update usd set amount=Convert(money,'10.00') where u_id = 83'

    • 'update TABLE set COLUMN=convert(money,'String')where u_id = 83;'

17.40 – unsuccessful ..

17.30

Use the type. Timestamp to get the current time in the Tomcat Server.

Static long | System.currentTimeMillis(); object

void Timestamp.setTime(long time)

// import a class,

'import java.lang.*;'

17.42

Use the CAST method – QSL92 standard.

17.47

Forget to change the executeUpdate with the query Update.

// rs = stmt.executeQuery(strSQL);

// affectRow = stmt.executeUpdate(strSQL);

// rs : ResultSet and affectRow : integer

18.05

// Step 5: Update the account

'String strAmount = String.valueOf(dblAmount);'

'strSQL = "update "+strTable+" set amount=Convert(money,'"+strAmount +"') where u_id='"+strUserID+"'";'

'stmt.executeUpdate(strSQL);'

18:40

Finished: bugs: when reload, the transaction continous and non-stop.

22.20

Can do the buy/sell functionally

Major re-factoring : can handling the different currency in one function , good for assignment 4.

01.20

Successfully used to buy and sell (with user u_id 83 and userName leungkac)

02.50
'Timestamp currentTime = new Timestamp( System.currentTimeMillis() );

query = "INSERT INTO transcation (update_time) VALUES ( ' " +

currentTime +

" ' )" ;

Timestamp currentTime = new Timestamp( System.currentTimeMillis() );

query = "INSERT INTO transcation (update_time) VALUES ( ' " +

currentTime +

" ' )" ;'

from Shing .

3.00

Finish the transaction.

0 Comments:

Post a Comment

<< Home