How to check which version of Jdk installed on the machine?

How to check which version of Jdk installed on the machine?& Which version of Oracle Insatlled on my machine?
[127 byte] By [gurusamy10a] at [2007-10-3 2:23:18]
# 1
From within a Java application?
kajbja at 2007-7-14 19:22:15 > top of Java-index,Java Essentials,New To Java...
# 2
java -version on the command line.%
duffymoa at 2007-7-14 19:22:15 > top of Java-index,Java Essentials,New To Java...
# 3
String version = System.getProperty("java.version"); %
duffymoa at 2007-7-14 19:22:15 > top of Java-index,Java Essentials,New To Java...
# 4
As for Oracle, make a JDBC connection, get the DatabaseMetaData, and get the version from that.%
duffymoa at 2007-7-14 19:22:15 > top of Java-index,Java Essentials,New To Java...
# 5
Thanks a lot
gurusamy10a at 2007-7-14 19:22:15 > top of Java-index,Java Essentials,New To Java...