Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

JDBC: Implementation of javax.sql.DataSource in Connect/J ?  RSS feed

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am wanting to try to use the MySQL driver from the official MySQL site. Reading tutorials it seems that getting a Connection using DriverManager is not the prefered method. Instead one should use an implementation of DataSource which exists eg. in org.apache.derby.jdbc. But I can find no class in com.mysql.jdbc implementing DataSource, so
does the official JDBC driver package (Connect/J) from MySQL itself not have an implementation of the class that is used in the prefered way of getting a Connection ?
 
Sheriff
Posts: 23696
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm surprised that a tutorial would suggest you should use a DataSource, but then not go on to provide an example. Could you post a link to some of these incomplete tutorials?
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only tutorials I know of are things like this:

http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-j2ee.html

But it has examples.

(I thought com.mysql.jdbc.jdbc2.optional.MysqlDataSource and a couple of other classes in optional implemented DataSource?)
 
Marshal
Posts: 60083
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our JDBC forum.
 
Michael Boehm
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the answers. I had started out reading Sun's tutorial on JDBC where I first read that one should stick with the DataSource solution and there was an example using org.apache.derby.jdbc.ClientDataSource. Then I moved on to MySQL's tutorial and missed the two lines where there was a reference to the optional package (com.mysql.jdbc.jdbc2.optional.MysqlDataSource). There is an example using DataSource at MySQL I see now, but it is "hidden" in an Enterprise Edition section.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!