Hi,
i am reposting this question that i initially posted in '
Servlets' forum..
i am writing a code that involves JDBC-ODBC in servlets. the place where i am currently stuck is:
i have a table named emp with 4 columns: name,title,city and country
now i need to write a query that first checks if the table is empty. if empty, new values are entered into the table. if the new data (entered by the user) already exists, the old values in the emp table should be overwritten by the new values.
how can this query be written???
{ i am using MS-Access as the database)
PS: the logic i have thought of (but finding it difficult to implememt) is that: first use the query "select * from emp" and assign the results to a ResultSet (say rs1). now we can check the contents of rs1. if empty, the insert statement can be written else an update statement is written.. will the above logic work and if yes, how to write such a code??