-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
alexeyvo
committed
Aug 10, 2016
0 parents
commit f534251
Showing
462 changed files
with
134,765 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* $Header: ADDRESS.java 15-mar-00.09:06:06 rbhyrava Exp $ */ | ||
|
||
/* Copyright (c) Oracle Corporation 2000. All Rights Reserved. */ | ||
|
||
/* | ||
DESCRIPTION | ||
<short description of component this file declares/defines> | ||
PRIVATE CLASSES | ||
<list of private classes defined - with one-line descriptions> | ||
NOTES | ||
<other useful comments, qualifications, etc.> | ||
MODIFIED (MM/DD/YY) | ||
rbhyrava 03/15/00 - AQ API demo -Jpub generated class for ADDRESS Type | ||
rbhyrava 03/15/00 - Creation | ||
*/ | ||
|
||
/** | ||
* @version $Header: ADDRESS.java 15-mar-00.09:06:06 rbhyrava Exp $ | ||
* @author rbhyrava | ||
* @since release specific (what release of product did this appear in) | ||
*/ | ||
|
||
/**** | ||
* Jpub generated class for for ADDRESS object type | ||
* Used in aqorademo02.java | ||
***/ | ||
import java.sql.SQLException; | ||
import java.sql.Connection; | ||
import oracle.jdbc.OracleTypes; | ||
import oracle.sql.ORAData; | ||
import oracle.sql.ORADataFactory; | ||
import oracle.sql.Datum; | ||
import oracle.sql.STRUCT; | ||
import oracle.jpub.runtime.MutableStruct; | ||
|
||
public class ADDRESS implements ORAData, ORADataFactory | ||
{ | ||
public static final String _SQL_NAME = "AQJAVA.ADDRESS"; | ||
public static final int _SQL_TYPECODE = OracleTypes.STRUCT; | ||
|
||
protected MutableStruct _struct; | ||
|
||
private static int[] _sqlType = { 12,12 }; | ||
private static ORADataFactory[] _factory = new ORADataFactory[2]; | ||
protected static final ADDRESS _ADDRESSFactory = new ADDRESS(false); | ||
|
||
public static ORADataFactory getORADataFactory() | ||
{ return _ADDRESSFactory; } | ||
/* constructor */ | ||
protected ADDRESS(boolean init) | ||
{ if(init) _struct = new MutableStruct(new Object[2], _sqlType, _factory); } | ||
public ADDRESS() | ||
{ this(true); } | ||
public ADDRESS(String street, String city) throws SQLException | ||
{ this(true); | ||
setStreet(street); | ||
setCity(city); | ||
} | ||
|
||
/* ORAData interface */ | ||
public Datum toDatum(Connection c) throws SQLException | ||
{ | ||
return _struct.toDatum(c, _SQL_NAME); | ||
} | ||
|
||
|
||
/* ORADataFactory interface */ | ||
public ORAData create(Datum d, int sqlType) throws SQLException | ||
{ return create(null, d, sqlType); } | ||
protected ORAData create(ADDRESS o, Datum d, int sqlType) throws SQLException | ||
{ | ||
if (d == null) return null; | ||
if (o == null) o = new ADDRESS(false); | ||
o._struct = new MutableStruct((STRUCT) d, _sqlType, _factory); | ||
return o; | ||
} | ||
/* accessor methods */ | ||
public String getStreet() throws SQLException | ||
{ return (String) _struct.getAttribute(0); } | ||
|
||
public void setStreet(String street) throws SQLException | ||
{ _struct.setAttribute(0, street); } | ||
|
||
|
||
public String getCity() throws SQLException | ||
{ return (String) _struct.getAttribute(1); } | ||
|
||
public void setCity(String city) throws SQLException | ||
{ _struct.setAttribute(1, city); } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/* $Header: AQDemoServlet.java 27-oct-2004.17:29:35 rbhyrava Exp $ */ | ||
|
||
/* Copyright (c) 2001, 2004, Oracle. All rights reserved. */ | ||
|
||
/* | ||
DESCRIPTION | ||
AQ Demo Servlet for OC4J configuration | ||
PRIVATE CLASSES | ||
<list of private classes defined - with one-line descriptions> | ||
NOTES | ||
<other useful comments, qualifications, etc.> | ||
MODIFIED (MM/DD/YY) | ||
rbhyrava 10/27/04 - enable tracing ; oc4j support | ||
rbhyrava 09/13/04 - Pass host,port,sid as arguments | ||
rbhyrava 03/11/02 - fix typo | ||
rbhyrava 02/20/02 - set host/port etc | ||
rbhyrava 04/12/01 - Merged rbhyrava_aqxmldemos | ||
rbhyrava 04/02/01 - Creation | ||
*/ | ||
|
||
/** | ||
* @version $Header: AQDemoServlet.java 27-oct-2004.17:29:35 rbhyrava Exp $ | ||
* @author rbhyrava | ||
* @since release specific (what release of product did this appear in) | ||
*/ | ||
|
||
import java.io.*; | ||
import javax.servlet.*; | ||
import javax.servlet.http.*; | ||
import oracle.AQ.*; | ||
import oracle.AQ.xml.*; | ||
import java.sql.*; | ||
import oracle.jms.*; | ||
import javax.jms.*; | ||
import java.io.*; | ||
import oracle.jdbc.pool.*; | ||
|
||
/** | ||
* This is a sample AQ Servlet for OC4J webserver configuration. | ||
*/ | ||
public class AQDemoServlet extends oracle.AQ.xml.AQxmlServlet | ||
{ | ||
|
||
public FileOutputStream ostream = null; | ||
//======================================================================== | ||
/* | ||
* getDBDrv - specify the database to which the servlet will connect | ||
*/ | ||
|
||
public AQxmlDataSource createAQDataSource() throws AQxmlException | ||
{ | ||
|
||
//String sid = "aq2"; | ||
//String port = "1521"; | ||
//String host = "stacj31"; | ||
|
||
AQxmlDataSource db_drv = null; | ||
String sid = System.getProperty("MYDB_SID"); | ||
String port = System.getProperty("MYDB_PORT"); | ||
String host = System.getProperty("MYDB_HOST"); | ||
|
||
System.out.println("AQDemoServlet - setting db driver using"); | ||
System.out.println("sid:" + sid + " port:" + port + " host:" + host ) ; | ||
|
||
db_drv = new AQxmlDataSource("scott", "tiger", sid, host, port); | ||
System.out.print("sid: "+ db_drv.getSid() ) ; | ||
System.out.print(" host: "+ db_drv.getHost() ) ; | ||
System.out.print(" port: "+ db_drv.getPort() ) ; | ||
System.out.print(" cachesize: "+ db_drv.getCacheSize() ) ; | ||
System.out.println(" cachescheme: "+ db_drv.getCacheScheme() ) ; | ||
|
||
return db_drv; | ||
} | ||
|
||
//======================================================================== | ||
public void init(ServletConfig cfg) | ||
{ | ||
AQxmlDataSource db_drv = null; | ||
|
||
try | ||
{ | ||
super.init(cfg); | ||
|
||
// Remove the comment below to enable tracing | ||
/* | ||
ostream = new FileOutputStream(fname) ; | ||
AQxmlDebug.setTraceLevel(5); | ||
AQxmlDebug.setDebug(true); | ||
//to write debug output to a file | ||
String fname = "/tmp/wsdemoservletdebug.log" ; | ||
File f = new File(fname) ; | ||
AQxmlDebug.setLogStream(ostream); | ||
// or to write debug output to standard err | ||
AQxmlDebug.setLogStream(System.err); | ||
*/ | ||
|
||
/* | ||
AQjmsOracleDebug.setLogStream(System.err); | ||
AQjmsOracleDebug.setTraceLevel(5); | ||
AQjmsOracleDebug.setDebug(true); | ||
*/ | ||
|
||
db_drv = this.createAQDataSource(); | ||
setAQDataSource(db_drv); | ||
|
||
setManualInvalidation(false); | ||
setSessionMaxInactiveTime(30); | ||
} | ||
catch (AQxmlException aq_ex) | ||
{ | ||
System.out.println("AQ exception: " + aq_ex); | ||
aq_ex.printStackTrace(); | ||
|
||
aq_ex.getNextException().printStackTrace(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
System.out.println("Exception: " + ex); | ||
ex.printStackTrace(); | ||
} | ||
} | ||
} |
Oops, something went wrong.