I know this is FAQ but I can't seem to get this to work. I need to return the last row in the table, I'm using auto_increment which is the 'priKey' column. 'beachName' is the name of the table , 'DATEOFFILE' is the column in the table that I need to return the last value for. The println outputs...
Just tested it - fantastic it works. Thanks r937 and azzazzello I think that I have been look at it for to long - if you know what I mean? And you did mention it in the first post r937 I just hadn't cottoned on to it......
This is nearly working now......The first time round the loop, it creates a table with a primary key column that that is set to 'auto increment'. Fine. Then it will insert the first row, I'm sure that the Statement.RETURN_GENERATED_KEYS
is being used wrongly, and as a result it won't insert the...
Thanks for your post r937 , I tried passing in Date objects but as I am using MySQL 4.0 something it prefers that date in the format 2005-03-23 ? Yes and the coloumn names are a bit dubious but this is just a prototype.
Anyway I am trying to use the AUTO_INCREMENT function, which I thought...
It keeps throwing a syntax error, I've been banging my head against a wall over it, can any one spot it? I trying to use AUTO_INCREMENT to create a primary key, the tutorial on the MySQL website I don't think is very clear?
statement.executeUpdate("CREATE TABLE `"...
Hi, a little date format problem: $result2 returns a String date from MySQL in the form 2005-03-23, and it is inserted in to a table. I just want to take that String and date format it into a day of the week 'Wed' for example, and insert that instead? Any help would be appreciated, thanks...
Just a little problem, this query is working..nearly... I just need it to return starting from the first instance of todays date, in the table? If anyone can help you'd be a lifesaver....
"SELECT * FROM Aberystwyth ORDER BY Date, Time LIMIT 20 ";
example:
"SELECT * FROM Aberystwyth...
Stuck on this I can't find an answer on the forums: it's simple all I need to do is write a statement to ask if the database has a table with a particular name already....
e.g
if (*****TableName = table already in DB)
{
statement.executeUpdate("INSERT INTO " + TableName +...
Hi, I'm trying to write a class that can access an FTP server, with a log in and password, navigate to a file in the directory and grab some files.
From what I can see there is no FTP support in the Java SDK API. I'm stuck can anyone give me any pointers?
Thanks in advance.....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.