Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8244183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:45:51+00:00 2026-06-07T21:45:51+00:00

To connect to derby database while using Tomcat , I downloaded the jar of

  • 0

To connect to derby database while using Tomcat, I downloaded the jar of core Apache Derby database engine (version : 10.9.1.0). I kept this jar file under the lib folder in Tomcat.

enter image description here

Now I was told to add the following in context.xml of Tomcat.

<Resource name="jdbc/PollDatasource" auth="Container" type="javax.sql.DataSource"
    driverClassName="org.apache.derby.jdbc.EmbeddedDriver" 
    url="jdbc:derby://localhost:1527/polldatabase;create=true"
    username="suhail" password="suhail"
    maxActive="20" maxIdle="10" maxWait="-1" />
  • What does this tag do ? I mean what it is meant for ?

  • Though the Jar file i downloaded contains the pattern org.apache.derby.jdbc.EmbeddedDriver where in this tag I mention the jar that I downloaded? Isn’t there a need to add the name of archive in the tag ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:45:53+00:00Added an answer on June 7, 2026 at 9:45 pm

    Once you put a jar under the Tomcat lib folder, Tomcat will automatically load it and put it in the classpath so all applications running on Tomcat know about this jar.

    The definition in the XML simply means you defined a datasource. A datasource is used in application servers to manage DB connection pools so you don’t have to, it is the preffered way instead of using plain JDBC.

    In the xml you defined : driverClassName="org.apache.derby.jdbc.EmbeddedDriver" and since you put the driver jar that contains this class, in the lib folder, it will know where to look for it without you needing to tell it where the jar is.

    Please note that putting the jar under Tomcat lib is not always the best solution since, like i said, all applications under tomcat will know of this jar, and if there is an application that already uses this jar with a different version, it might cause conflicts.

    A better solution might be to put the jar under WEB-INF/lib and that way only this application knows of the jar.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded the jar of Core Apache Derby database engine, which also includes the
I am trying to connect to derby database while using Tomcat . I try
I've been trying to connect to an Apache Derby/JavaDB embedded database using Oracle SQL
I try to connect to the database with this code: try { Class.forName(org.apache.derby.jdbc.ClientDriver); String
Using the embedded driver I can connect to my derby database using the JDBC
I develop some unit tests with trying to connect to the Derby internal database
I connect to a mysql database using pymysql and after executing a request I
I have an Apache Derby database running (in networked mode) inside a java swing
I have (java) code that creates and populates tables in a derby database, using
I'm working on a database backup engine using JPA. Everything is working fine but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.