The moose likes JDBC and Relational Databases and the fly likes long data type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "long data type" Watch "long data type" New topic

long data type

padma patil
Ranch Hand

Joined: Nov 06, 2001
Posts: 41
I am generating unique id as
long id= System.currentTimeMillis();
I wanted to store this value into MySql table.
But Mysql doesn't support long datatype.
If I convert Long to int then it will truncate the extra part.
What shall I do? I need to generate unique id and add it to table.

I wanted to assign
Mahesh Mamani
Ranch Hand

Joined: Jun 25, 2001
Posts: 110
MySql has a Timestamp data-type which can be used for your purpose. U can use the Timestamp data-type in Java for this...
Use this URL for ref.

Hope It Helps

I agree. Here's the link:
subject: long data type
It's not a secret anymore!