diff --git a/tools/ExperimentSynchronizer/lib/postgresql-9.4-1201.jdbc4.jar b/tools/ExperimentSynchronizer/lib/postgresql-9.4-1201.jdbc4.jar deleted file mode 100755 index 0cd5ce20e02fb5632acd2158c2d98ccf2d5c94a0..0000000000000000000000000000000000000000 Binary files a/tools/ExperimentSynchronizer/lib/postgresql-9.4-1201.jdbc4.jar and /dev/null differ diff --git a/tools/ExperimentSynchronizer/manifest.txt b/tools/ExperimentSynchronizer/manifest.txt new file mode 100644 index 0000000000000000000000000000000000000000..96f0315dfb1d567d738548d6f2676f767070835c --- /dev/null +++ b/tools/ExperimentSynchronizer/manifest.txt @@ -0,0 +1,2 @@ +Main-Class: gov.anl.dm.esafsync.Gui +Class-Path: ../lib/ojdbc7.jar ../lib/javax.json-api-1.0.jar ../lib/jdatepicker-1.3.4.jar diff --git a/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/OracleConnection.java b/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/OracleConnection.java index f91bfe76abcf54d13e8d48d7801921965e919629..1de55e4ac57f3e297763f1e0acb5fe2b84451217 100644 --- a/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/OracleConnection.java +++ b/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/OracleConnection.java @@ -16,8 +16,10 @@ public class OracleConnection { DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); connection = DriverManager.getConnection( config.getProperty("oracle.database.connection"), - config.getProperty("oracle.database.username"), - config.getProperty("oracle.database.password")); +// config.getProperty("oracle.database.username"), +// config.getProperty("oracle.database.password")); + "glob_conn", + "ur2ytkownicy2u"); } String getExperiments(String sector, String lower, String upper) throws SQLException { diff --git a/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/PsqlConnection.java b/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/PsqlConnection.java deleted file mode 100644 index cdfc388953b0f2fdaa508f662127efc5d5ea6199..0000000000000000000000000000000000000000 --- a/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/PsqlConnection.java +++ /dev/null @@ -1,91 +0,0 @@ -package gov.anl.dm.esafsync; - -import java.sql.DriverManager; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Properties; - -public class PsqlConnection { - public final class UserInfo { - private final String signature; - private final int id; - - UserInfo(String signature, int id) { - this.signature = signature; - this.id = id; - } - String getSignature() { - return signature; - } - - int getId() { - return id; - } - } - - final int ADMIN_ROLE_ID = 1; - Connection connection = null; - - public void connect(Properties config) throws SQLException, ClassNotFoundException { - Class.forName("org.postgresql.Driver"); - connection = DriverManager.getConnection( - config.getProperty("dm.database.connection"), - config.getProperty("dm.database.username"), - config.getProperty("dm.database.password")); - } - - UserInfo getUserInfo(String user) throws SQLException { - String signature = null; - int id = -1; - Statement statement = connection.createStatement(); - if (statement != null) { - ResultSet results = statement.executeQuery("SELECT * FROM user_info WHERE username = '" + user + "';"); - if (results != null) { - while (results.next()) { - signature = results.getString("password"); - if (signature.length() > 0) { - id = Integer.parseInt(results.getString("id")); - break; - } - } - results.close(); - } - statement.close(); - } - if (id < 0) { - return null; - } else { - return new UserInfo(signature, id); - } - } - - boolean isAuthorized(int id) throws SQLException { - boolean isAuthorized = false; - Statement statement = connection.createStatement(); - if (statement != null) { - ResultSet results = statement.executeQuery("SELECT * FROM user_system_role WHERE user_id = " + id + ";"); - if (results != null) { - while (results.next()) { - int roleId = Integer.parseInt(results.getString("role_type_id")); - if (roleId == ADMIN_ROLE_ID) { - isAuthorized = true; - break; - } - } - results.close(); - } - statement.close(); - } - return isAuthorized; - } - - void close() { - try { - connection.close(); - } catch (SQLException ex) { - // nothing to do here - } - } -} diff --git a/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/serviceconn/ServiceConnection.java b/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/serviceconn/ServiceConnection.java index bb6d0d151b30aaae32152c513eb71dc9076f2ac0..6eb7b4686dee6d688cbad5ac495836389b9e011d 100644 --- a/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/serviceconn/ServiceConnection.java +++ b/tools/ExperimentSynchronizer/src/gov/anl/dm/esafsync/serviceconn/ServiceConnection.java @@ -115,7 +115,6 @@ public class ServiceConnection { } String protocol = this.serviceUrl.getProtocol(); - System.out.println("protocol "+ protocol); if (protocol == null) { JOptionPane.showMessageDialog(null,"Unsupported service protocol specified in " + serviceUrl, "Error",JOptionPane.ERROR_MESSAGE); return ServiceConnectionStatus.ERROR;