You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
964 B
33 lines
964 B
package de.superx.bin; |
|
|
|
import java.sql.Connection; |
|
import java.sql.DriverManager; |
|
import java.sql.Statement; |
|
|
|
public class Pgcheck { |
|
|
|
/** |
|
* @param args |
|
*/ |
|
public static void main(String[] args) { |
|
System.out.println("INFO: argumente connectionURL username [passwd]"); |
|
if (args.length >= 2) { |
|
try { |
|
System.out.println("Teste Verbindung ..."); |
|
Class.forName("org.postgresql.Driver"); |
|
String passwd = "dummy"; |
|
if (args.length > 2) passwd = args[2]; |
|
Connection conn = DriverManager.getConnection(args[0], args[1], passwd); |
|
Statement st = conn.createStatement(); |
|
System.out.println("Verbindung erfolgreich"); |
|
st.close(); |
|
conn.close(); |
|
} catch (Exception e) { |
|
System.out.println(e); |
|
} |
|
} |
|
|
|
} |
|
} |
|
|
|
//Created on 19.02.2009 at 11:34:00
|