OpenJPA
  1. OpenJPA
  2. OPENJPA-580

Need a better algorithm to find DBDictionary classname in DBDictionaryFactory

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.1, 1.3.0, 2.0.0-M2
    • Component/s: jdbc
    • Labels:
      None

      Description

      When I debug OpenJPA code, I am surprised to find that it creates an instance of AccessDictionary for a sample application which uses Derby.

      The sample application is copied from book "Pro EJB3". The connection URL for the persistence unit is:
      jdbc:derby://localhost:1527/fieldAccess;create=true

      Since it contains 'Access' in the URL value, the OpenJPA code assumes it uses Access database.

      We need a better algorithm to find classname for DBDictionary in DBDictionaryFactory. For example, we can assume the database is Access only if the URL starts with 'jdbc:access'.

        Issue Links

          Activity

          Hide
          Albert Lee added a comment -

          After committing OPENJPA-780 changes, I researched a little more on this issue and collected the jdbc: url of various database, here is a list for future reference.

          Oracle
          jdbc:oracle:<drivertype>:@<hostname>:<port>:<database_sid>
          jdbc:oracle:thin://<host>:<port>/<service>
          jdbc:oracle:thin:<host>:<port>:<SID>
          jdbc:oracle:thin:<TNSName>

          Oracle OCI
          jdbc:oracle:oci://<host>:<port>/<service>
          jdbc:oracle:oci:<host>:<port>:<SID>
          jdbc:oracle:oci:<TNSName>

          MS SQLServer 2000 Driver
          jdbc:microsoft:sqlserver://host:port;databasename=name;user=yourUser;password=yourPwd

          MS SQLServer 2005 Driver
          jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

          MS SQLServer (Sprinta)
          jdbc:inetdae7:<HOST>:<PORT>?database=<DB>

          MS SQLServer (JTurbo)
          jdbc:JTurbo://<HOST>:<PORT>/<DB>

          MS Access
          jdbc:odbc:Driver=

          {Microsoft Access Driver (*.mdb)}

          ;DBQ=[Full path to your database file];DriverID22;

          jTDS JDBC Driver
          jdbc:jtds:microsoft://<host>[:<port>][/<database>]
          jdbc:jtds:sqlserver://server[:port][/database][;property=value[;...]]
          jdbc:jtds:sybase://server[:port][/database][;property=value[;...]]

          mySQL
          jdbc:mysql://[host][,failoverhost...][:port]/[database]
          jdbc:mysql://[host:port],[host:port].../[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]

          PostgreSQL
          jdbc:postgresql:database
          jdbc:postgresql://host/database
          jdbc:postgresql://host:port/database

          JBOSS
          jdbc:AvenirDriver://127.0.0.1:1433/master;uid=sa;pwd=sa
          jdbc:merant:sqlserver://suresh:1433
          jdbc:JSQLConnect://localhost/database=Master&user=sa&password=sa
          jdbc:weblogic:mssqlserver4:Master@suresh:1433?user=sa&password=sa

          SyBase
          jdbc:sybase:Tds:<host>:<port>?ServiceName=<database_name>

          Intersystems Cache
          jdbc:Cache://<host>:<port>/<namespace>

          DaffodilDBDriver
          jdbc:daffodilDB_embedded:<database>
          jdbc:daffodilDB://<host>:<port3456>/<database>

          DB2
          jdbc:db2://<host>:<port50000>/<database>

          DB2/400 (toolbox) JDBC connection URL
          jdbc:as400://systemname

          Front Base
          jdbc:FrontBase://<host>:<port>/<database>

          Hypersonic SQL (in-process)
          jdbc:hsqldb:file:/opt/db/testdb

          Hypersonic SQL (in-memory)
          jdbc:hsqldb:mem:aname

          Hypersonic SQL (server)
          jdbc:hsqldb:<database>
          jdbc:hsqldb:hsql://<host>:<port>

          Informix
          jdbc:informix-sqli://<host>:<port>/<database>:informixserver=<dbservername>

          Derby
          jdbc:derby:net://<host>:<port1527>/<databaseName>

          Cloudscape
          jdbc:cloudscape:MyDataBase

          Cloudscape RMI
          jdbc:rmi://hostname:portnumber/jdbc:cloudscape:MyDatabase

          Mimer
          jdbc:mimer://<host>:<port>/<database>

          Pervasive
          jdbc:pervasive://<host>:<port>/<database>

          PointBase
          jdbc:pointbase:embedded:PBPUBLIC
          jdbc:pointbase:server://<host>:<port>/<database>

          Interbase
          jdbc:interbase:jndi:LDAP_hostname:port_number/...

          Borland JDataStore
          jdbc:borland:dsremote://hostName/path/storeName.jds
          jdbc:borland:dslocal:storeName.jds

          EasySoft
          jdbc:easysoft://servername/datasource:logonuser=username:logonpassword=password

          PointBase
          jdbc:empress:DATABASE=
          jdbc:empress://SERVER=localhost;PORT=6322
          jdbc:pointbase:embedded:sample

          Interbase (Java driver) / FireBird
          jdbc:firebirdsql:[host[/port]:]<database>
          jdbc:firebirdsql:localhost/3050:/firebird/test.gdb

          Interbase (Interclient driver)
          jdbc:interbase://localhost:3060/C:/firebird/test.gdb

          H2 Database (embedded)
          jdbc:h2:test

          H2 Database (Client Server)
          jdbc:h2:tcp://localhost:9092/test

          H2 Database (In Memory)
          jdbc:h2:{

          {.|mem:}

          [name] | file:fileName |

          {tcp|ssl}

          ://server[:port][,server2[:port]]/name }[;key=value...]

          Ingres JDBC connection URL
          jdbc:edbc://localhost:II7/database

          Albert Lee.

          Show
          Albert Lee added a comment - After committing OPENJPA-780 changes, I researched a little more on this issue and collected the jdbc: url of various database, here is a list for future reference. Oracle jdbc:oracle:<drivertype>:@<hostname>:<port>:<database_sid> jdbc:oracle:thin://<host>:<port>/<service> jdbc:oracle:thin:<host>:<port>:<SID> jdbc:oracle:thin:<TNSName> Oracle OCI jdbc:oracle:oci://<host>:<port>/<service> jdbc:oracle:oci:<host>:<port>:<SID> jdbc:oracle:oci:<TNSName> MS SQLServer 2000 Driver jdbc:microsoft:sqlserver://host:port;databasename=name;user=yourUser;password=yourPwd MS SQLServer 2005 Driver jdbc:sqlserver://[serverName [\instanceName] [:portNumber] ][;property=value [;property=value] ] MS SQLServer (Sprinta) jdbc:inetdae7:<HOST>:<PORT>?database=<DB> MS SQLServer (JTurbo) jdbc:JTurbo://<HOST>:<PORT>/<DB> MS Access jdbc:odbc:Driver= {Microsoft Access Driver (*.mdb)} ;DBQ= [Full path to your database file] ;DriverID22; jTDS JDBC Driver jdbc:jtds:microsoft://<host> [:<port>] [/<database>] jdbc:jtds:sqlserver://server [:port] [/database] [;property=value [;...] ] jdbc:jtds:sybase://server [:port] [/database] [;property=value [;...] ] mySQL jdbc:mysql:// [host] [,failoverhost...] [:port] / [database] jdbc:mysql:// [host:port] , [host:port] .../ [database] [?propertyName1] [=propertyValue1] [&propertyName2] [=propertyValue2] PostgreSQL jdbc:postgresql:database jdbc:postgresql://host/database jdbc:postgresql://host:port/database JBOSS jdbc:AvenirDriver://127.0.0.1:1433/master;uid=sa;pwd=sa jdbc:merant:sqlserver://suresh:1433 jdbc:JSQLConnect://localhost/database=Master&user=sa&password=sa jdbc:weblogic:mssqlserver4:Master@suresh:1433?user=sa&password=sa SyBase jdbc:sybase:Tds:<host>:<port>?ServiceName=<database_name> Intersystems Cache jdbc:Cache://<host>:<port>/<namespace> DaffodilDBDriver jdbc:daffodilDB_embedded:<database> jdbc:daffodilDB://<host>:<port3456>/<database> DB2 jdbc:db2://<host>:<port50000>/<database> DB2/400 (toolbox) JDBC connection URL jdbc:as400://systemname Front Base jdbc:FrontBase://<host>:<port>/<database> Hypersonic SQL (in-process) jdbc:hsqldb: file:/opt/db/testdb Hypersonic SQL (in-memory) jdbc:hsqldb:mem:aname Hypersonic SQL (server) jdbc:hsqldb:<database> jdbc:hsqldb:hsql://<host>:<port> Informix jdbc:informix-sqli://<host>:<port>/<database>:informixserver=<dbservername> Derby jdbc:derby:net://<host>:<port1527>/<databaseName> Cloudscape jdbc:cloudscape:MyDataBase Cloudscape RMI jdbc:rmi://hostname:portnumber/jdbc:cloudscape:MyDatabase Mimer jdbc:mimer://<host>:<port>/<database> Pervasive jdbc:pervasive://<host>:<port>/<database> PointBase jdbc:pointbase:embedded:PBPUBLIC jdbc:pointbase:server://<host>:<port>/<database> Interbase jdbc:interbase:jndi:LDAP_hostname:port_number/... Borland JDataStore jdbc:borland:dsremote://hostName/path/storeName.jds jdbc:borland:dslocal:storeName.jds EasySoft jdbc:easysoft://servername/datasource:logonuser=username:logonpassword=password PointBase jdbc:empress:DATABASE= jdbc:empress://SERVER=localhost;PORT=6322 jdbc:pointbase:embedded:sample Interbase (Java driver) / FireBird jdbc:firebirdsql:[host [/port] :]<database> jdbc:firebirdsql:localhost/3050:/firebird/test.gdb Interbase (Interclient driver) jdbc:interbase://localhost:3060/C:/firebird/test.gdb H2 Database (embedded) jdbc:h2:test H2 Database (Client Server) jdbc:h2:tcp://localhost:9092/test H2 Database (In Memory) jdbc:h2:{ {.|mem:} [name] | file: fileName | {tcp|ssl} : // server [:port] [,server2 [:port] ]/name } [;key=value...] Ingres JDBC connection URL jdbc:edbc://localhost:II7/database Albert Lee.
          Hide
          David Ezzio added a comment -

          Merged changes on DBDictionaryFactory and TestDictionaryFactory to Branch 1.1.x at rev 784867.

          Show
          David Ezzio added a comment - Merged changes on DBDictionaryFactory and TestDictionaryFactory to Branch 1.1.x at rev 784867.

            People

            • Assignee:
              Albert Lee
              Reporter:
              Jason Zheng
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development