JDBC Tutorials - Herong's Tutorial Examples - v3.14, by Herong Yang
Compile and Run Java Programs
This section describes how to compile and run Java programs.
When JDK is installed on your machine, it provides two commands for you to compile and run Java programs.
Let's try these commands with a very simple Java program. Use NotePad to enter the following Java program into a file called Hello.java:
class Hello { public static void main(String[] a) { System.out.println("Hello world!"); } }
Then compile this program in a command window with the "javac" command:
herong> javac Hello.java
To execute the program, use the java command:
herong> java Hello Hello world!
Congratulations, you have successfully entered, compiled and executed your first Java program.
Table of Contents
JDBC (Java Database Connectivity) Introduction
Downloading and Installing JDK on Windows
Adding JDK "bin" Directory to Path Setting
Downloading and Installing JDK on Mac
Downloading and Installing JDK on Linux
►Compile and Run Java Programs
-cp or -classpath Syntax on Different Systems
JDK Documentation Installation
Installing and Running Derby (Java DB)
Derby (Java DB) JDBC DataSource Objects
Derby (Java DB) - DML Statements
Derby (Java DB) - ResultSet Objects of Queries
Derby (Java DB) - PreparedStatement
Summary of JDBC Drivers and Database Servers