JSP for mySQL to Oracle
Posted on 2003-11-24
I have a small program that is written using JSP using mySQL at the backend (development) and I am thinking to move it to Oracle (production). There are a few conversion issues and I appreciate your input and suggestions:
1. In mySQL there is auto_increment function but not in Oracle 9i. In my JSP sql (that uses mySQL) I could have just use
insert into t_emp (id, name) value ('', 'Joe Black');
In oracle I uses sequence and the sql looks like:
insert into t_emp values (emp_seq.nextval, 'Joe Black');
How could I use just 1 type of sql for both databases?
2. If I use NOW() in the DATETIME in mySQL in some INSERT statement, what should I replace with in Oracle? sysdate seems to be doing the equivalent.
My real questions is, using JSP, how could I program in such a way that my program is independent of the database at the backend?