Solved

java ,oracle database to sql server database

Posted on 2008-06-12
2
168 Views
Last Modified: 2010-03-30
Hello experts,

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(" values(");
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.

Thank you.

0
Comment
Question by:dex11
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 21772490
The best way for portability is to let sequencing occur invisibly if possible
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21989837
:-)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now