[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

java ,oracle database to sql server database

Posted on 2008-06-12
2
Medium Priority
?
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video teaches viewers about errors in exception handling.
Suggested Courses

649 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