Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6757

Driver.connect() returns null when using file-based URL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 10.11.1.1
    • None
    • JDBC
    • None
    • Normal
    • Embedded/Client difference

    Description

      The following program can be used to reproduce this issue:

      import java.sql.Driver;
      import java.sql.DriverManager;
      import java.util.Properties;
      
      public class Test {
      
          public static void main(String[] args) throws Exception {
              Driver d = (Driver) Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
      
              Properties properties = new Properties();
              properties.setProperty("user", "TEST");
              properties.setProperty("password", "TEST");
              System.out.println(d.connect("jdbc:derby:C:/data/derby/test;create=true", properties));
              System.out.println(DriverManager.getConnection("jdbc:derby:C:/data/derby/test;create=true", properties));
          }
      }
      

      When run, the above program will output something like:

      {monospace}
      null
      org.apache.derby.impl.jdbc.EmbedConnection@1226204845 (XID = 18681), (SESSIONID = 1), (DATABASE = C:/data/derby/test), (DRDAID = null) {monospace}

      Attachments

        Activity

          People

            Unassigned Unassigned
            lukas.eder Lukas Eder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: