Results 1 to 3 of 3
Thread: How to create auto-increment
- 07-04-2007, 05:18 AM #1
Senior Member
- Join Date
- Jun 2007
- Posts
- 114
- Rep Power
- 0
- 07-04-2007, 05:21 AM #2
Member
- Join Date
- Jun 2007
- Posts
- 92
- Rep Power
- 0
Auto-increment is usually implemented at the database layer.
For example, if we have a table in MySQL and it is define as:
As you can see from the above definition, the "id" should be automatically incremented by the database.Java Code:table users { id int(13) not null auto_increment, name varchar( 45 ) not null default '', email varchar( 55 ) not null default '', website varchar( 100 ) not null default '', primary key( id ) }
The above statement can be executed the same way outside, or inside a JSP page.
If you are not sure about JDBC and how it works, here is a good tutorial that demonstrates JDBC connections, data manipulations etc.
Greetings
Marcus:cool:
- 07-04-2007, 05:23 AM #3
Senior Member
- Join Date
- Jun 2007
- Posts
- 114
- Rep Power
- 0
Similar Threads
-
Increment a Variable
By rhm54 in forum New To JavaReplies: 2Last Post: 06-14-2008, 02:57 AM -
Auto Update Function
By abiieez in forum New To JavaReplies: 4Last Post: 04-16-2008, 04:17 PM -
Object ArrayList - increment solution needed badly!!
By rugbyGeek in forum New To JavaReplies: 4Last Post: 03-08-2008, 12:47 AM -
turn off auto compile
By bugger in forum EclipseReplies: 3Last Post: 01-04-2008, 08:12 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks