Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Connection Pool not working

 
Ranch Hand
Posts: 176
4
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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: 25930
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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: 176
4
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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: 25930
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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: 12409
269
  • Mark post as helpful
  • send pies
  • 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: 22634
153
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • 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: 25930
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.)
 
I will suppress my every urge. But not this shameless plug:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic