java ,oracle database to sql server database
Posted on 2008-06-12
I used oracle database for my application before and would like to change my database to sql server 2005 database.I used lot of sequences in oracle( example :create sequence CLIENT_ID_SEQ;) and have statements like below in my JDBC code.
StringBuffer query = new StringBuffer();
query.append("INSERT INTO ");
query.append("CLIENT_DTLS"); // the table to insert.
query.append("CLIENT_ID_SEQ.NEXTVAL,?,?,?,sysdate)"); // the sequence CLIENT_ID_SEQ.NEXTVAL
above query i used it for preparedstatement.
As i came to know sql server doesn't have sequences and has identity for auto increment.How do you suggest me to get around this problem with out disturbing the code(jdbc code) much and have the same thing done in sql server database.Please Help.