adding current_timestamp

Hi,

I am currently trying to add a timestamp+(variable) to my mssql database via a JSP. I can add the simple time stamp by doing the following:

...

PreparedStatement ps = connection.prepareStatement("INSERT INTO table1 VALUES (?,?,?, CURRENT_TIMESTAMP+5)");

...

...which adds 5 days to the current date. However if i wanted to replace '5' with a variable how do i go about doing this. i have tried for example:

...

String extraDays = 5;(just for example)

...

PreparedStatement ps = connection.prepareStatement("INSERT INTO table1 VALUES (?,?,?, CURRENT_TIMESTAMP+extraDays)");

...

also tried by replacing with:

CURRENT_TIMESTAMP+"extraDays"

CURRENT_TIMESTAMP+'extraDays'

but none of them seem to work.

Any help would be gladly appreciated.

Message was edited by:

haggard17

[891 byte] By [haggard17a] at [2007-11-27 10:00:26]
# 1
PreparedStatement ps = connection.prepareStatement("INSERT INTO table1 VALUES (?,?,?, CURRENT_TIMESTAMP+"+extraDays+")");
cotton.ma at 2007-7-13 0:31:45 > top of Java-index,Java Essentials,Java Programming...
# 2
awesome that worked!Much appreciated.
haggard17a at 2007-7-13 0:31:45 > top of Java-index,Java Essentials,Java Programming...