Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Using Spring to instantiate a DBCP DataSource with Kerberos

Thread view: 
Varian - 30 Nov 2005 20:29 GMT
Hi,

I am using the Spring framework with Hibernate. I am currently
instantiating and populating a DBCP BasicDataSource
(org.apache.commons.dbcp.BasicDataSource) with credentials using
Spring. The BasicDataSource uses Sybase's JDBC drivers to connect to a
Sybase database.

I would like to use Kerberos instead of passing in the credentials in
the Spring xml file. To do this, I have to set some of the connection
properties like REQUEST_KERBEROS_SESSION and SERVICE_PRINCIPAL_NAME.
However, BasicDataSource has no setter method for it's proteted
connectionProperites field, so I don't see how I can use Spring to do
this.

I noticed that BasicDataSourceFactory's createDataSource method takes a
Properties argument and returns a BasicDataSource. However, I don't see
how this could be configured in a Spring xml file to give me a
BasicDataSource bean either, since it has to call a method.

Can anyone advise on how I can do this?

I haven't had any luck with Google or newsgroups and I hope this is the
correct group to post to. Thanks for your help in advance!

Regards,

-=Varian=-
Varian - 01 Dec 2005 18:23 GMT
Looks like Spring can use static factory methods to create beans by
specifying the factory class in the class attribute and also specifying
a factory-method attribute.

> Hi,
>
[quoted text clipped - 24 lines]
>
> -=Varian=-


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.