Solved

java ,oracle database to sql server database

Posted on 2008-06-12
2
170 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

813 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

12 Experts available now in Live!

Get 1:1 Help Now