#pragma section-numbers off = 用意する物 = [http://www.cygwin.com cygwin] [http://www.neuro.gatech.edu/users/cwilson/cygutils/cygipc/index.html cygipc] = 設定 = WinNT/2kなどではサービスに登録可能です。 {{{ ipc-daemon --install-as-service net start ipc-daemon }}} 管理ツールのサービスで登録された事を確認してください。 postgresqlの設定 {{{ initdb -E EUC_JP -D /usr/share/postgresql/data cygrunsrv --install PostgreSQL --path /usr/bin/postmaster --args "-D /usr/share/postgresql/data -i" --dep ipc-daemon --termsig INT --user postgres --shutdown }}} postgresqlもサービスに登録します。登録内容がうまくできている事を確認する。 = 参考サイト = [http://www.neuro.gatech.edu/users/cwilson/cygutils/index.html Utilities for Cygwin] [http://www.terra-intl.com/unix.html WindowsでUNIX環境を] [http://www.geocities.jp/kinjotks/dev/pgsql/index.html PostgreSQLで遊ぼう] {{{ import java.sql.*; public class TestPostgreSQL { public static void main(String argv[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection( "jdbc:postgresql://ipaddress/template1", "sakito", "" ); Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery("SELECT now();"); while (rset.next()) { System.out.println(rset.getString(1)); } rset.close(); stmt.close(); conn.close(); } }}} ---- ["PostgreSQL"] CategoryDatabase CategoryLink CategoryUnix