一个关于数据源的问题,目前还没有人搞定,看谁是第一个吃螃蟹的人!!!!!!!
<bean id= "datasource_dev " class= "org.apache.commons.dbcp.BasicDataSource " destroy-method= "close ">
<property name= "driverClassName " value= "oracle.jdbc.driver.OracleDriver " />
<property name= "url " value= "jdbc:oracle:thin:@192.168.52.1*:1521:**** " />
<!-- <property name= "url " value= "jdbc:oracle:thin:@localhost:1521:eeqagu " /> -->
<property name= "username " value= "**** " />
<property name= "password " value= "***** " />
</bean>
怎样从以上数据源的配置文件中取出Connection对象??能取得到吗我在??
[解决办法]
你是为了从DataSource中获取Connection对象
还是为了获取Jdbc的配置信息?
[解决办法]
不明白你想做什么?
如果只是要取得connection,很简单啊
DateSource ds = cxt.loopup( "datasource_dev ");
Connection conn = ds.getConnection();