summaryrefslogtreecommitdiffstats
path: root/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples
diff options
context:
space:
mode:
authordims <dims@13f79535-47bb-0310-9956-ffa450edef68>2008-06-17 00:23:01 +0000
committerdims <dims@13f79535-47bb-0310-9956-ffa450edef68>2008-06-17 00:23:01 +0000
commitbdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch)
tree38a92061c0793434c4be189f1d70c3458b6bc41d /sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples')
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersService.java43
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersServiceImpl.java74
-rw-r--r--sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/StoredProcs.java42
3 files changed, 159 insertions, 0 deletions
diff --git a/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersService.java b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersService.java
new file mode 100644
index 0000000000..f301483be3
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersService.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.samples.das.orders;
+
+import java.util.ArrayList;
+import java.util.Vector;
+
+import commonj.sdo.DataObject;
+
+public interface CustomersOrdersService {
+
+ //dynamic way - demoed in J2SE client only
+ public void execute(Vector params);
+ public DataObject executeQuery(Vector params);
+ public void applyChanges(Vector params);
+ public DataObject executeAdhoc(Vector params);//adhoc query implementation - not done
+
+ //static way - demoed in JSP, J2SE clients
+ public DataObject getAllCustomers(Vector paramsList);
+ public DataObject getRangeCustomers(Vector paramsList);
+ public void getInsertCustomerExecute(Vector paramsList);
+ public void getInsertCustomerApplyChanges(Vector paramsList);
+ public void getDeleteCustomerExecute(Vector paramsList);
+ public void getDeleteCustomerApplyChanges(Vector paramsList);
+ public void getUpdateCustomer(Vector paramsList);
+ public DataObject getNamedCustomers(Vector paramsList);
+}
diff --git a/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersServiceImpl.java b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersServiceImpl.java
new file mode 100644
index 0000000000..ffd02a8f85
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/CustomersOrdersServiceImpl.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.samples.das.orders;
+
+import java.util.Vector;
+import commonj.sdo.DataObject;
+
+public class CustomersOrdersServiceImpl implements CustomersOrdersService {
+
+ //dynamic way
+ public void execute(Vector params) {
+ }
+
+ public DataObject executeQuery(Vector params){
+ return null;
+ }
+
+ public void applyChanges(Vector params){
+
+ }
+
+ public DataObject executeAdhoc(Vector params){
+ return null;
+ }
+
+ // static way
+ public DataObject getAllCustomers(Vector paramsList){
+ return null;
+ }
+
+ public DataObject getRangeCustomers(Vector paramsList){
+ return null;
+ }
+
+ public void getInsertCustomerExecute(Vector paramsList){
+ return ;
+ }
+
+ public void getInsertCustomerApplyChanges(Vector paramsList){
+ return ;
+ }
+
+ public void getDeleteCustomerExecute(Vector paramsList){
+ return ;
+ }
+
+ public void getDeleteCustomerApplyChanges(Vector paramsList){
+ return ;
+ }
+
+ public void getUpdateCustomer(Vector paramsList){
+ return;
+ }
+
+ public DataObject getNamedCustomers(Vector paramsList){
+ return null;
+ }
+}
diff --git a/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/StoredProcs.java b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/StoredProcs.java
new file mode 100644
index 0000000000..fd064f006e
--- /dev/null
+++ b/sandbox/lresende/backup/container.das.client/src/main/java/org/apache/tuscany/samples/das/orders/StoredProcs.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.samples.das.orders;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+//Example stored procedure in Derby
+public class StoredProcs {
+ public static void getNamedCustomers(String theName, int[] outCount, ResultSet[] results) throws SQLException {
+
+ Connection conn = DriverManager.getConnection("jdbc:default:connection");
+ PreparedStatement ps = conn.prepareStatement("SELECT * FROM CUSTOMER WHERE LASTNAME = ?");
+ ps.setString(1, theName);
+ results[0] = ps.executeQuery();
+
+ ps = conn.prepareStatement("SELECT COUNT(*) FROM CUSTOMER WHERE LASTNAME = ?");
+ ps.setString(1, theName);
+
+ ResultSet rs = ps.executeQuery();
+ rs.next();
+ outCount[0] = rs.getInt(1);
+ }
+}