Message1110
Logged In: YES
user_id=769940
jython code
-----------
from java.sql import *
from java.lang import *
from org.postgresql.util import PSQLException
conn = None
try:
Class.forName("org.postgresql.Driver")
url = "jdbc:postgresql:mydb"
user = "admin"
password = " "
conn = DriverManager.getConnection(url, user, password)
except ClassNotFoundException:
print("Unable to load Driver Class ")
except SQLException, e:
print e
try:
stmt = conn.createStatement()
stmt.execute("aaaaa")
except (SQLException), se:
print 'SQLException'
java code
----------
public String test ()
{
Connection conn = null;
try {
Class.forName("org.postgresql.Driver");
String url = "jdbc:postgresql:mydb";
String user = "admin";
String password = " ";
conn = DriverManager.getConnection(url, user,
password);
} catch (ClassNotFoundException e) {
System.out.println("Unable to load Driver Class ");
System.exit(0);
} catch (SQLException ee) {
ee.printStackTrace();
System.exit(0);
}
try {
Statement stmt = conn.createStatement();
stmt.execute("aaaaa");
} catch (SQLException se) {
System.out.println("sqlexception");
se.printStackTrace();
}
return null;
} |
|
Date |
User |
Action |
Args |
2008-02-20 17:17:28 | admin | link | issue1447857 messages |
2008-02-20 17:17:28 | admin | create | |
|