Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
move password from source code into resource file
  • Loading branch information
donald committed May 8, 2015
1 parent ce69db3 commit 5fe678a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/de/mpg/molgen/buczek/portifix/Gui.java
Expand Up @@ -21,6 +21,7 @@
import java.sql.SQLException;
import java.text.ParseException;
import java.util.Date;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractAction;
Expand All @@ -47,12 +48,15 @@ public class Gui extends javax.swing.JFrame {
useTestDatabase
? "jdbc:firebirdsql://portier-db//project/portier/firebird/data/x.fdb?encoding=UTF8"
: "jdbc:firebirdsql://portier-db/portiervision.fdb?encoding=UTF8";


private void filltable() {
try {

String password=new Scanner(getClass().getResourceAsStream("password.dat"),"UTF-8").useDelimiter("\\A").next();

if (connection == null) {
connection = DriverManager.getConnection(connectString, "sysdba", "***REMOVED***");
connection = DriverManager.getConnection(connectString, "sysdba",password);
tableModel.setConnection(connection);
}
tableModel.populate();
Expand Down Expand Up @@ -210,7 +214,7 @@ public void run() {
if (!useTestDatabase) {
testDatabaseLabel.setVisible(false);
}

jTable1.addMouseListener(popupListener);

jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
Expand Down

0 comments on commit 5fe678a

Please sign in to comment.