Ignore:
Timestamp:
2021-02-16T14:19:04+13:00 (3 years ago)
Author:
davidb
Message:

Updated to have default values from 'port' and 'database' options. Prints out the connection URL formed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/tipple-bridge/trunk/src/src/main/java/sqlCli.java

    r34880 r34885  
    4040    String password;
    4141
    42     @Option(names = {"--port"},  description = "Port number")
     42    @Option(names = {"--port"},  description="Port number", defaultValue="3306")
    4343    int portNo;
    4444
    45     @Option(names = {"--dbname"}, description = "Name of the db")
     45    @Option(names = {"--dbname"}, description="Name of the database", defaultValue="tippleTest")
    4646    String dbName;
    4747
     
    8686            Class.forName("com.mysql.cj.jdbc.Driver");
    8787            //opening the connection
    88             System.out.println("Connecting to database: ");
     88            System.out.println("Connecting to database:");
     89        System.out.println("  " + dbUrl);
     90       
    8991            conn = DriverManager.getConnection(dbUrl, user, pass);
    90             //conn = DriverManager.getConnection(dbUrl, user, pass);
    9192
    9293            //create and execute query
     
    108109
    109110            Gson myGSon = new Gson();
    110            file.write("[");
     111        file.write("[");
    111112
    112113            //does nothing, assuming the try catch picks up the error first,
Note: See TracChangeset for help on using the changeset viewer.