*
The moose likes JDBC and the fly likes to use sequence in JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "to use sequence in JDBC" Watch "to use sequence in JDBC" New topic
Author

to use sequence in JDBC

Megha Singhal
Ranch Hand

Joined: Feb 28, 2012
Posts: 182

i don't have permission to access oracle database so i have to work on predesigned tables, in one of my field i have to auto increament that field and i can't create sequence in oracle database so is there is any way to do that through servlet . i mean using queries.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

This has absolutely nothing to do with servlets, so it's been moved to the JDBC forum with an appropriate change of title.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Srinivasan Duraisamy
Greenhorn

Joined: Apr 17, 2012
Posts: 2
I am not sure what kind of access you have with Oracle , So could not give any solution from DB level.

But if your application going to run in only one server then you can use plain text file for your sequence source.

Using synchronized block you can generate sequence from the text file.

For better performance use Cache .

Thanks
Srinivasan. D
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

I would go an talk to your DBA (or whoever designed the tables) they MUST have created a sequence for this index field, or had a plan how you were going to use it.
If they didn't explain to them why they need to create one for it.

Just because you don't have permissin to do something, doesn't mean you can't get it done.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: to use sequence in JDBC
 
Similar Threads
EJB and Database
Pros & Cons on J2EE Table GenerationTypes
difference between native and increment gernerators
Get id of auto-number
How to represent a sequence in oracle in HQL