close

Online syntax highlighting

線上直接輸入code後選擇想要表示的語言便會自動幫我們轉換成適合blog用的HTML

 

以下為測試結果

1. eclipse呈現

import java.sql.Connection;
import java.sql.DriverManager;

public class JDBC1 {

    
    
    public static void main(String[] args) {
        System.out.println("開始要連囉");
        try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            System.out.println("Loading JDBC-ODBC driver sucess.");

            Connection con = DriverManager.getConnection("jdbc:odbc:john", "","");
            System.out.println("connecting to data base sucess.");
            con.close();
        } catch (Exception e) {
            System.out.println("Loading JDBC-ODBC driver error.");
        }

    }
}

 

2.black背景

import java.sql.Connection;
import java.sql.DriverManager;

public class JDBC1 {

    
    
    public static void main(String[] args) {
        System.out.println("開始要連囉");
        try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            System.out.println("Loading JDBC-ODBC driver sucess.");

            Connection con = DriverManager.getConnection("jdbc:odbc:john", "","");
            System.out.println("connecting to data base sucess.");
            con.close();
        } catch (Exception e) {
            System.out.println("Loading JDBC-ODBC driver error.");
        }

    }
}
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 tedmouse 的頭像
    tedmouse

    松鼠窩

    tedmouse 發表在 痞客邦 留言(0) 人氣()