• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection Pool not working

 
Ranch Hand
Posts: 271
6
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again


So, you see I decided to go with the flow and check out that thing called a Connection pool and give it a spin. Thing is, it is not working even though I followed This Tutorial to the letter

Or I hope I have been :|



And here's my stacktrace





 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your Maven POM exactly match what's in the tutorial? And when you ran Maven, did it run successfully?
 
Yosuf Ibrahim
Ranch Hand
Posts: 271
6
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Does your Maven POM exactly match what's in the tutorial? And when you ran Maven, did it run successfully?



Sorry for teh stupid question, but what is maven??
 
Paul Clapham
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a widely-used tool which goes out to various internet sites and downloads the software necessary to support things.

The first picture in the tutorial you linked to contains the XML file which Maven would use. I suppose that since the tutorial didn't specifically say to do anything with that, you're justified in ignoring it completely and claiming that you followed the tutorial "to the letter".

I would suggest finding a different tutorial. Learning Maven just so that you can complete this step is, I think, far too much of a diversion.
 
Saloon Keeper
Posts: 15529
364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree that it looks like a poor tutorial, but on the other hand I also believe Maven should be standard knowledge for any Java programmer who is at the level of using connection pools.

IF Yosuf Ibrahim doesn't have to rush to finish this task, now is as good a time as any to learn Maven.
 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to make sure we all know what we're actually talking about here.

When you say "use a Connection Pool", we normally expect that means that you're going to be working with a multi-user system such as a webserver where your actual application will be a Connection Pool client.

But the code sample is what I'd expect to see if you were trying to implement a Connection Pool [bserver.[/b] Which would generally be built as a JAR ibrary to be either plugged into a framework that supports Connection Pools or as part of a stand-alone Pool Client application (which isn't often done).

To be a Connection Pool client as a web application, you don't need any Apache code. You just need the javax.sql.DataSource interface which is part of the J2EE and JEE implementations and a way to locate that DataSource implementation, which is usually via a JNDI lookup. The Connection Pool itself is a plug-in component to the webapp server, and generally one will already have been bundled as part of the webapp server.

If you actually are attempting to define a wholly new Connection Pool librarty we'd need to know more about what it was expected to do that none of the ready-made Connection Pool implementations don't do.
 
Paul Clapham
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:I agree that it looks like a poor tutorial, but on the other hand I also believe Maven should be standard knowledge for any Java programmer who is at the level of using connection pools.

IF Yosuf Ibrahim doesn't have to rush to finish this task, now is as good a time as any to learn Maven.



I suppose that's right too. When I installed a connection pool (in March 2019) I chose c3p0, which didn't have any external dependencies and which documented what jar files needed to go in your classpath. So I didn't need Maven, which was fortunate because I've never used it. But when I upgraded my version of Apache POI (in March 2020) there were a lot of external dependencies which I had to track down the hard way, and knowing Maven would have been useful then.

(In other words: you can see my bias regarding Maven.)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic