Your error shows that your oracle service is not running
hope the following code helps
Thanks
* Naveen
class JdbcTest {
public static void main (
String args []) throws SQLException {
// Load Oracle driver
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
// Connect to the local database
Connection conn = DriverManager.getConnection ("jdbc

racle

ci8:@mydatabase", "scott", "tiger");
// Query the employee names
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("select ename from emp");
// Print the name out while (rset.next ()) System.out.println (rset.getString (1));
}
}