Table of Contents

Java

Basic

Preparing

Examples

(자료형 인수, ...) -> { ... 임의의 처리 ...}

Database

import java.sql.*;

...
...
  Connection conn = null;
  
  try
  {
    Class.forName("DRIVER");
  }
  catch(ClassNotFoundException e)
  {
    e.printStackTrace();
  }
  
  try
  {
    conn = DriverManager.getConnection("jdbc database", "user", "password");
    
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("QUERY");
    
    while(rset.next())
    {
      // do something
    }
  }
  catch(SQLException e)
  {
    e.printStackTrace();
  }
  finally
  {
    if(conn != null)
    {
      try
      {
        conn.close();
        conn = null;
      }
      catch(SQLException e)
      {
        e.printStackTrace();
      }
    }
  }
  
...
...

File I/O

Tests

Reserved Words

References