• 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

Using DriverManager.getConnection() to configure a DataSource

 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which version of JBoss AS are you using?
 
Greg Charles
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JBoss 7.
 
reply
    Bookmark Topic Watch Topic
  • New Topic