Solved

java ,oracle database to sql server database

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java imports not found 4 30
swing controls 2 16
Location of Dynamics AX Service accounts in SQL 3 16
Need return values from a stored procedure 8 21
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
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.

828 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