Results 1 to 1 of 1
- 06-11-2011, 08:45 PM #1
Member
- Join Date
- May 2011
- Posts
- 56
- Rep Power
- 0
Setting Auto increment problem :(-:
I have a problem with my java apllication that i am unable to create a enitity persistence class..
The problem is that it does not takes the database table for entity class that doesn't have PRIMARY KEY..
I found a way for it by applying PRIMARY KEY as AUTOINCREMENT column..
But, since my application is to be work continuosly with database i cannot estimate a typical auto-increment value limit..
Now what i want is to apply a composit primary key with "date" , "id" column as primary keys together, the "id" must be a AUTO-INCREMENT value that can reset itself from the begening whenever a day changes , i.e, id values resets itself after each day ??
How can i achive this ??
What i tried is like something as follows::
But it does not yeild me required result...Any suggestions please????Java Code:create table test ( id int(4) zerofill auto_increment, mydate date, primary key (mydate,id) ); insert into test (mydate) values ('2011-06-01'), ('2011-06-02'), ('2011-06-02'), ('2011-06-01'), ('2011-06-01'), ('2011-06-03');
Similar Threads
-
auto scrollbar Problem
By prats_7189 in forum AWT / SwingReplies: 1Last Post: 02-11-2010, 01:38 PM -
Auto contrast and auto brightness
By oxxxis in forum Java 2DReplies: 0Last Post: 01-21-2010, 08:32 PM -
Problem in setting Eclipse
By Crisanto in forum New To JavaReplies: 3Last Post: 10-29-2008, 06:48 PM -
Auto-complete/Auto-fix for custom statement
By dark_cybernetics in forum EclipseReplies: 0Last Post: 08-19-2008, 11:19 AM -
How to create auto-increment
By Albert in forum JDBCReplies: 2Last Post: 07-04-2007, 05:23 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks