File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How ti get the current time on the database server? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "How ti get the current time on the database server?" Watch "How ti get the current time on the database server?" New topic
Author

How ti get the current time on the database server?

Cameron Bruce
Greenhorn

Joined: Jun 12, 2003
Posts: 4
Is it possible to get the current time on the remote database server?
All I have is the URL (contains the IP address).
thanks.
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15229

Depends on how you want to get it. All DBMS have a function to get the current time. MySQL, you can use the NOW() function and that will fetch the time on the server. If you are using Servlets of anykind, you could write a simple servlet to get the current time on the Server.
Hope that points you in the right direction.
John Haake
Greenhorn

Joined: Jun 23, 2003
Posts: 10
For an oracle database server:
SELECT TO_CHAR( sysdate, 'HH24:MI:SS' ) FROM DUAL
which, of course, returns a String result.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How ti get the current time on the database server?
 
Similar Threads
Current System date & time(URGENT)
How do demo softwares expire?
date and time in sql
local time vs server time
Resultset based on current Date and Time