Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Oracle 8i Insertion of records...Very Urgent..

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi friends,
i am in a very specific context in which i got a doubt.
here it is......
i have a link on a web page, over which 100's of hits can occur per second.
i just want to INSERT the hit on my link into the database Oracle 8i.
my problem here is, if 100 users hit my link at the SAME time, up to the same millisecond, is there any way to distinguish all the 100 users by inserting the hit in Oracle 8i, by using java.util.date/java.sql.date.
I want to store that hit date as "long" of java.util.date in the database.
my actual idea is, by differentiating all the 100 users to different time stamps(even by millisecond), i just want to make that date column UNIQUE in my database..
TIA,prasadbh.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you need it for? You could perhaps add a field with the user's session ID. Or generate a synthetic primary key using a sequence. It depends on what you need the data for.
- Peter
 
prasad bhn
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Peter..
you are right in the case of synthetic primary key using a sequence. We already planned this way, as the LAST Option.
But we believe in the long form of date, as we can get Nano seconds of the hit, by using java.sql.Timestamp class, we are hopeful that we can get the solution in some way.
But we came to notice that, when i apply MY PROBLEM for creating ordinary objects in a standalone program using below code, nano seconds concept also doesnt work.
import java.util.Date;
import java.sql.Timestamp;
public class TimeStampNanoSeconds
{
public static void main(String[] args)
{
Date d=new Date();
Nano(d);
}
public static void Nano(Date date)
{
Timestamp ts=new Timestamp(date.getTime());
System.out.print(date.getTime());
System.out.println("\tNano==="+ts.getNanos());
Date d1=new Date();
Nano(d1);
}
}
but we are hopeful that we will get a UNIQUE "long" number when it is in the case INSERTION into database table or any other databse transactions.
AM I confusing anybody?? if so, dont hesitate to clarify with me...
Many Thanks One and All,prasadbh.
 
prasad bhn
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
Can you help us by giving sample code to generate a Synthetic Primary Key( generalized/independent on the columns of the table)
..
TIA,prasadbh
 
prasad bhn
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i got the solution and it is based on Synthetic Primary key only.
------------------
iic systems pvt ltd.,
babukhan millennium center,
somajiguda,
hyderabad-38.
 
It will give me the powers of the gods. Not bad for a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic