[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/script DBShell.java,1.3,1.4 IDRSScript.java,1.1
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:35
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/script Modified Files: DBShell.java IDRSScript.java IdrsDB.java Log Message: Added Initial EJB Support Index: DBShell.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/DBShell.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DBShell.java 18 Sep 2001 03:18:57 -0000 1.3 --- DBShell.java 17 Mar 2003 14:05:01 -0000 1.4 *************** *** 1,83 **** ! /* ! DBShell.java ! Copyright (C) 2001 Marc Boorshtein ! ! The contents of this file are subject to the Mozilla Public License Version 1.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.mozilla.org/MPL/ ! ! Software distributed under the License is distributed on an "AS IS" basis, ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific ! language governing rights and limitations under the License. ! */ ! package net.sourceforge.idrs.script; ! ! import net.sourceforge.idrs.utils.DB; ! /** Acts as a protective shell for passing data results to methods */ ! public class DBShell implements IdrsDB { ! private DB db; ! String id; ! /** Creates a new DBShell based on an id and a db @param id ID of DB being encapsulated ! @param db DB to be encapsulated ! */ ! public DBShell(String id,DB db) { ! this.id = id; ! this.db = db; ! } ! ! ! /** ! Retrieves DBShell's db ! */ ! public DB getDB() throws Exception { ! return db; ! } ! ! /** ! Calls db's next() method ! */ ! public boolean next() throws Exception { ! return db.next(); ! } ! ! /** Calls db's getFieldData method @param fieldname NAme of field being rechreaved ! @param format Format string being used, null if none ! */ ! public String getFieldData(String fieldname,String format) throws Exception { ! String data; ! data = db.getFieldData(fieldname,format); ! ! return data; ! } ! ! /** Calls getFieldData with no format @param fieldname NAme of field being rechreaved */ ! public String getFieldData(String fieldname) throws Exception { ! return getFieldData(fieldname,null); ! } ! /** Retrieves the results from an input db */ ! public int getUpdateResult() throws Exception { ! return db.getUpdateResult(); ! } ! ! /** Calls db's moveTo method ! @param location Index of results to move to ! */ ! public boolean moveTo(int location) throws Exception { ! return db.moveTo(location); ! } ! } --- 1,83 ---- ! /* ! DBShell.java ! Copyright (C) 2001 Marc Boorshtein ! ! The contents of this file are subject to the Mozilla Public License Version 1.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.mozilla.org/MPL/ ! ! Software distributed under the License is distributed on an "AS IS" basis, ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific ! language governing rights and limitations under the License. ! */ ! package net.sourceforge.idrs.script; ! ! import net.sourceforge.idrs.utils.DB; ! /** Acts as a protective shell for passing data results to methods */ ! public class DBShell implements IdrsDB { ! private DB db; ! String id; ! /** Creates a new DBShell based on an id and a db @param id ID of DB being encapsulated ! @param db DB to be encapsulated ! */ ! public DBShell(String id,DB db) { ! this.id = id; ! this.db = db; ! } ! ! ! /** ! Retrieves DBShell's db ! */ ! public DB getDB() throws Exception { ! return db; ! } ! ! /** ! Calls db's next() method ! */ ! public boolean next() throws Exception { ! return db.next(); ! } ! ! /** Calls db's getFieldData method @param fieldname NAme of field being rechreaved ! @param format Format string being used, null if none ! */ ! public String getFieldData(String fieldname,String format) throws Exception { ! String data; ! data = db.getFieldData(fieldname,format); ! ! return data; ! } ! ! /** Calls getFieldData with no format @param fieldname NAme of field being rechreaved */ ! public String getFieldData(String fieldname) throws Exception { ! return getFieldData(fieldname,null); ! } ! /** Retrieves the results from an input db */ ! public int getUpdateResult() throws Exception { ! return db.getUpdateResult(); ! } ! ! /** Calls db's moveTo method ! @param location Index of results to move to ! */ ! public boolean moveTo(int location) throws Exception { ! return db.moveTo(location); ! } ! } Index: IDRSScript.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/IDRSScript.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IDRSScript.java 17 Feb 2003 02:48:47 -0000 1.10 --- IDRSScript.java 17 Mar 2003 14:05:01 -0000 1.11 *************** *** 23,26 **** --- 23,28 ---- import net.sourceforge.idrs.utils.UserInfo; import net.sourceforge.idrs.core.servlet.MultiPartRequest; + import java.sql.*; + import javax.ejb.*; public interface IDRSScript { *************** *** 145,147 **** --- 147,151 ---- /** retrieves the name of the last property set */ public String getPropParamName(); + + public EJBObject getEJB(Connection con, String name, String home, String remote, boolean session) throws Exception; } Index: IdrsDB.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/IdrsDB.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IdrsDB.java 18 Sep 2001 03:18:57 -0000 1.3 --- IdrsDB.java 17 Mar 2003 14:05:01 -0000 1.4 *************** *** 1,53 **** ! /* ! IdrsDB.java ! Copyright (C) 2001 Marc Boorshtein ! ! The contents of this file are subject to the Mozilla Public License Version 1.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.mozilla.org/MPL/ ! ! Software distributed under the License is distributed on an "AS IS" basis, ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific ! language governing rights and limitations under the License. ! */ ! ! package net.sourceforge.idrs.script; ! /** Interface used by all IDRS Data Stores */ ! public interface IdrsDB { ! /** ! pre:rs is populated<br> ! post:if the there is another record,<br> ! advance a record<br> ! readin the fields<br> ! else return false */ ! public boolean next() throws Exception; ! /** Retrieves data from a perticuler field with a given format @param fieldname Name of field being rechreaved ! @param format Format string being used, null if none ! */ public String getFieldData(String fieldname,String format) throws Exception; ! /** Retrieves data from a perticuler field @param fieldname Name of field being rechreaved ! */ public String getFieldData(String fieldname) throws Exception; /** Retrieves the results from an input db ! */ ! public int getUpdateResult() throws Exception; ! ! /** Moves to a specific record ! @param location Index of results to move to ! */ ! public boolean moveTo(int location) throws Exception; ! } --- 1,53 ---- ! /* ! IdrsDB.java ! Copyright (C) 2001 Marc Boorshtein ! ! The contents of this file are subject to the Mozilla Public License Version 1.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.mozilla.org/MPL/ ! ! Software distributed under the License is distributed on an "AS IS" basis, ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific ! language governing rights and limitations under the License. ! */ ! ! package net.sourceforge.idrs.script; ! /** Interface used by all IDRS Data Stores */ ! public interface IdrsDB { ! /** ! pre:rs is populated<br> ! post:if the there is another record,<br> ! advance a record<br> ! readin the fields<br> ! else return false */ ! public boolean next() throws Exception; ! /** Retrieves data from a perticuler field with a given format @param fieldname Name of field being rechreaved ! @param format Format string being used, null if none ! */ public String getFieldData(String fieldname,String format) throws Exception; ! /** Retrieves data from a perticuler field @param fieldname Name of field being rechreaved ! */ public String getFieldData(String fieldname) throws Exception; /** Retrieves the results from an input db ! */ ! public int getUpdateResult() throws Exception; ! ! /** Moves to a specific record ! @param location Index of results to move to ! */ ! public boolean moveTo(int location) throws Exception; ! } |