• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Using DriverManager.getConnection() to configure a DataSource

 
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working with a really, really old DBMS, which nevertheless does have a JDBC driver. We are able to configure a JEE DataSource within JBoss to talk to this database, but now we need to enable SSL across this connection. The problem is that the documentation describing how to do this are for the moldy old DriverManager.getConnection() method of getting a connection. Basically, you set up a bunch a properties, then pass them in to the method, like this:



I'm trying to figure out how to translate those instructions into configuring a datasource, but getting very little help from the DB vendor's technical support. I'm thinking that maybe I could set up my own connection pool, using the DriverManager to fill it up with connection, and then point my datasource at that connection pool. Does that sound like a reasonable approach? More crucially, is there a tutorial somewhere that might show how to pull something like that off?
 
Sheriff
Posts: 21788
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how JBoss does it, but in Tomcat the resources use the same URLs as required for DriverManager. An example:
Or do you need to supply a Properties object to DriverManager to get the connection?
 
Greg Charles
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, there are some properties involved. Things like the cipher being used, the location and password for the trust store file, the security level (I'm not clear what this one does). I feel like it might be possible to translate the instructions I have for the DriverManager into configuring a data source, but I'm slightly too stupid to work it out, and their tech support is even stupider than I am. It's extremely frustrating.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of JBoss AS are you using?
 
Greg Charles
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBoss 7.
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!