I'd much appreciate any help on this I have tried all sorts with this.
Basically I have an SQL database, which I want to save some data to, I know how to do this with all the other fields I have, but I also want to save the current time with this data.
str = "INSERT INTO tblResults (username, curTime, outcome) " +
"VALUES(" + "'" + user + "'" +", " + (new Timestamp(date.getTime())) + ", " + "'" + outcome + "'" +")";
and then I execute the string, this was an example of one of my many attempts, this attempt compiles, but I get an error:
Incorrect syntax near '16'. Error saving result
16 being the hour right now... I think its because a time stamp puts the time before the date and an sql does the opposite, but I have no idea on how to fix this, so I'd appreciate any help. Thanks