Latest News

the latest news from our team

JDBC – URL Formatting

URL Formatting

Start with this:

String url;
      Class c = Class.forName( "com.minisoft.jdbc.MSJDBCDriver" );
      String hostname = "127.0.0.1";
      String portnum = "30504";

      url = "jdbc:MSJDBC:///";      
      if ( args.length > 1 ) {
            hostname = args[1];
            if ( args.length > 2 ) {
                  portnum = args[2];
            }
            url = "jdbc:MSJDBC://" + hostname + ":" + portnum + "/";
      }

Add this:

      Properties p = new Properties();
      p.put( "Server", "192.168.1.70" );
      p.put( "ServerPort", "30007" );
      p.put( "ServerType", "0" );
      p.put( "User", "MGR" );
      p.put( "UserPassword", "PASSWORD" );
      p.put( "Account", "MINISOFT" );
      p.put( "ImageDatabase0", "MSCARD,DO-ALL,1,5" );
      p.put( "Group", "" );
      
      Connection con = DriverManager.getConnection( url, p );

Or this:

      url = url+"?"
          + "Server=192.168.1.70&"
          + "ServerPort=30007&"
          + "ServerType=0&"
          + "User=MGR&"
          + "UserPassword=PASSWORD&"
          + "Account=MINISOFT&"
          + "ImageDatabase0=MSCARD.NEAL,DO-ALL,1,5&"
          + "Group=&";
      
      Connection con = DriverManager.getConnection( url );

Leave a Reply

Your email address will not be published. Required fields are marked *