Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using DriverManager.getConnection() to configure a DataSource

 
Greg Charles
Sheriff
Posts: 2993
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 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?
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java 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: 2993
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 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.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
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: 2993
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBoss 7.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic