[ 
https://issues.apache.org/jira/browse/DERBY-7115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338658#comment-17338658
 ] 

Richard N. Hillegas commented on DERBY-7115:
--------------------------------------------

The location of Derby's public JDBC drivers can be confusing to newcomers. We 
have been improving the documentation about the drivers (see the linked 
issues). The public drivers live in derbytools.jar. The only way you would 
glean this fact from the Getting Started Guide, would be to consult the section 
on manually setting the CLASSPATH/MODULEPATH: 
https://db.apache.org/derby/docs/10.15/getstart/tgs26250.html If you scroll 
down that page to the result of echoing $CLASSPATH, then you will see that you 
need four jar files on the classpath: derby.jar, derbyshared.jar, 
derbytools.jar, and derbyoptionaltools.jar. The last one is optional.

So you need another two dependencies in your maven stanza. Something like this:

{noformat}
<dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derbyshared</artifactId>
    <version>10.15.2.0</version>
</dependency>
<dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derby</artifactId>
    <version>10.15.2.0</version>
</dependency>
<dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derbytools</artifactId>
    <version>10.15.2.0</version>
</dependency>
{noformat}

More information will be included in the public api javadoc for Derby's next 
version. Maybe we should include template maven dependency stanzas for 
stereotypical use-cases. I see a lot of misinformation in the top search 
results for the terms "maven dependencies apache derby".

The 10.15 release family requires Java 9 or higher. See 
https://db.apache.org/derby/derby_downloads.html

The Getting Started Guide is very old. It pre-dates the introduction of driver 
autoloading. It pre-dates the uptake of maven as an artifact distribution 
mechanism.

> Outdated documentation 'Getting Started'
> ----------------------------------------
>
>                 Key: DERBY-7115
>                 URL: https://issues.apache.org/jira/browse/DERBY-7115
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 10.15.2.0
>            Reporter: Hiran Chaudhuri
>            Priority: Minor
>
> I just tried to start a new project using the Derby embedded database. For my 
> first steps I followed 
> [https://db.apache.org/derby/docs/10.15/getstart/getstartderby.pdf.]
> According to the guide on page 31, I need to load
> String driver = "org.apache.derby.jdbc.EmbeddedDriver";
> although that class cannot be found on the classpath - and this despite I 
> configured maven with
> {{ <dependency>}}
> {{    <groupId>org.apache.derby</groupId>}}
> {{    <artifactId>derby</artifactId>}}
> {{    <version>10.15.2.0</version>}}
> {{ </dependency>}}
> When looking at derby-10.15.2.0.jar I find the file 
> /META-INF.services/java.sql.Driver, and the content is
> {{org.apache.derby.iapi.jdbc.AutoloadedDriver}}
> Should that not be the driver name to be loaded for the tutorial? If not, 
> where is the missing class?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to