KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > oracle > jms > OracleInContainerJmsConnector


1 /*
2  * $Id: OracleInContainerJmsConnector.java 4219 2006-12-09 10:15:14Z lajos $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers.oracle.jms;
12
13 import javax.jms.JMSException JavaDoc;
14 import javax.sql.DataSource JavaDoc;
15 import java.sql.Connection JavaDoc;
16 import java.sql.SQLException JavaDoc;
17
18 /**
19  * JMS Connector for Oracle AQ that uses a user provided data source for database connectivity
20  */

21 public class OracleInContainerJmsConnector extends AbstractOracleJmsConnector
22 {
23
24     private DataSource JavaDoc dataSource;
25
26     public DataSource JavaDoc getDataSource()
27     {
28         return dataSource;
29     }
30
31     public void setDataSource(DataSource JavaDoc dataSource)
32     {
33         this.dataSource = dataSource;
34     }
35
36     public Connection JavaDoc getJdbcConnection() throws JMSException JavaDoc
37     {
38         try
39         {
40             return dataSource.getConnection();
41         }
42         catch (SQLException JavaDoc e)
43         {
44             throw new JMSException JavaDoc("Unable to open JDBC connection: " + e.getMessage());
45         }
46     }
47
48 }
49
Popular Tags