From 200a40b332420f94992eb39a6d0ea1cf1490ffc4 Mon Sep 17 00:00:00 2001 From: coreyg Date: Fri, 21 Nov 2014 09:30:19 +0000 Subject: Adding tuscany's website to their svn repo for svnpubsub git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1640879 13f79535-47bb-0310-9956-ffa450edef68 --- .../connection-support-for-j2se-environment.html | 158 +++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 site/trunk/site-publish/connection-support-for-j2se-environment.html (limited to 'site/trunk/site-publish/connection-support-for-j2se-environment.html') diff --git a/site/trunk/site-publish/connection-support-for-j2se-environment.html b/site/trunk/site-publish/connection-support-for-j2se-environment.html new file mode 100644 index 0000000000..0c34c44053 --- /dev/null +++ b/site/trunk/site-publish/connection-support-for-j2se-environment.html @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + Apache Tuscany : Connection support for J2SE environment + + + + + + + + + + + + + + + +
+ + + + +   + +
+ + +
+
+ + + + + + + + + +
+  Apache Tuscany > Home > DAS Overview > DAS Java > DAS Java Documentation Menu > DAS Java Developer Guide > RDB DAS Java > RDB DAS - User Guide > Connection support for J2SE environment + + User List | Dev List | Issue Tracker   +
+ + + + + + + +
+ + +
+ +
+
+

Connection support for J2SE environment

+ +

So far DAS utilized JDBC Connection - either explicitly supplied by DAS invoker or available in the runtime context pre-configured using JNDI.

+ +

DAS config needs to have provision to support JDBC Connection for J2SE environment, when JNDI is not configured and connection is not explicitly supplied by the DAS invoker.

+ +

Below are the changes in DAS Config xsd. The attribute dataSource and element ConnectionProperties
+are mutually exclusive. User needs to specify ONLY one of these. When ConnectionProperties is specified, DriverManager for appropriate database vendor is used to instantiate the JDBC Connection.
+This way the J2SE applications can use DAS.

+ +

When dataSource is specified, the JNDI context is searched for pre-configured dataSource. This mode is useful, when Web Containers like Tomcat have the resource pre-defined for the dataSource.

+ +
+
   <xsd:complexType name="ConnectionProperties">
+      <xsd:attribute name="driverClass" type="xsd:string"/>
+      <xsd:attribute name="databaseURL" type="xsd:string"/>
+      <xsd:attribute name="userName" type="xsd:string" default=""/>
+      <xsd:attribute name="password" type="xsd:string" default=""/>
+      <xsd:attribute name="loginTimeout" type="xsd:int" default="0"/>      
+   </xsd:complexType>
+   
+   <xsd:complexType name="ConnectionInfo">
+      <xsd:sequence>
+        <xsd:element  maxOccurs="1" minOccurs="0" name="ConnectionProperties" type="config:ConnectionProperties"/>
+      </xsd:sequence>
+      <xsd:attribute name="dataSource" type="xsd:string"/>
+      <xsd:attribute name="managedtx" type="xsd:boolean" default="true"/>
+   </xsd:complexType>
+
+
+ +

Below is one example DAS config, using Derby database.

+ +
+
 <Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd"> 
+    
+    <!--Uncomment below for derby test-->
+	<ConnectionInfo>
+		<ConnectionProperties
+			driverClass="org.apache.derby.jdbc.EmbeddedDriver"
+			databaseURL="jdbc:derby:target/dastest; create = true"
+			loginTimeout="600000"/>
+	</ConnectionInfo>
+   ....
+  </Config>
+
+
+
+
+
+ + +
+ + + + + + website stats + + + + + + -- cgit v1.2.3