Skip to content
Snippets Groups Projects
Commit 680b7a33 authored by tjc's avatar tjc
Browse files

specifying command line chado url

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@3212 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 1acacbdf
No related branches found
No related tags found
No related merge requests found
...@@ -148,6 +148,28 @@ public class DatabaseEntrySource implements EntrySource ...@@ -148,6 +148,28 @@ public class DatabaseEntrySource implements EntrySource
JTextField inUser = new JTextField("es2"); JTextField inUser = new JTextField("es2");
bacross.add(inUser); bacross.add(inUser);
// given -Dchado=localhost:port/dbname?username
if(System.getProperty("chado") != null)
{
String db_url = System.getProperty("chado").trim();
int index;
if((index = db_url.indexOf(":")) > -1)
{
inServer.setText(db_url.substring(0,index));
int index2;
if((index2 = db_url.indexOf("/")) > -1)
{
inPort.setText(db_url.substring(index+1,index2));
int index3;
if((index3 = db_url.indexOf("?")) > -1)
{
inDB.setText(db_url.substring(index2+1,index3));
inUser.setText(db_url.substring(index3+1));
}
}
}
}
int n = JOptionPane.showConfirmDialog(null, bacross, int n = JOptionPane.showConfirmDialog(null, bacross,
"Enter Database Address", "Enter Database Address",
JOptionPane.OK_CANCEL_OPTION, JOptionPane.OK_CANCEL_OPTION,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment