Using J2EE EJB Container and Oracle 8.1.7

I am trying to setup the J2EE EJB container to use and Oracle 8.1.7 database instead of Cloudscape. So far I have done the following
0. Created the table for the Savings Account tutorial in the Oracle Database.
1. Added the Classes12.jar (Oracle's latest JDBC thin drivers) to my CLASSPATH
2. Under "Server Configuration" I added the standard/jdbc drivers value: "oracle.jdbc.driver.OracleDriver".
3. Under "Server Configuration" I added the standard/datasource value: JNDI name "jdbc/Oracle" and JDBC URL "jdbc:oracle:thin:@10.1.1.254:1521:DEV".
4. For the savings account tutorial, when deploying I specified "jdbc/Oracle" for the reference "jdbc/SavingsAccountDB".
I have gotten this tutorial to work using the Cloudscape database. After I did the previous steps and tried to run the client, I get no valid driver available, unable to connect to Oracle.
What else to I need to do?
My setup is:
Windows 2000 Professional
J2EE (JDK 1.3.1)
Oracle 8.1.7
Thank you in advance.

Exactly which classpath did you add the Oracle JDBC library jar to ?
The thing that works for me is to have the following line in the file %J2EE_HOME%\bin\userconfig.bat
set J2EE_CLASSPATH=D:\DownLoad\Oracle\classes12_01.zip;

Similar Messages

  • How ejb-jar.xml is Used by ejb Container

    Hi,
        Can anyone please explain me about how ejb-jar.xml is Used by ejb Container when a request is sent by a client(ie StandAlone program or a WebService)
    Thanks in Advance
    Venkat.

    Hi Benny,
    Nice answer to a self explainig question :-).
    Regards,
    Daniel
    p.s. THX to Sun and J2EE 5 and especially EJB3 (and don't forget about SAP, NWCE is really cool!!!)

  • Help building an e-commerce site using DreamWeaver MX 2004 and Oracle 10G

    I'm new to using Oracle 10G. After reviewing several rdms's I've picked Oracle 10G as my rdms. I'm trying to build an ecommerce site using DreamWeaver MX 2004 and Oracle 10G. The website will be selling hardware and software products. I have a choice in DreamWeaver to go for a .asp or .jsp setup. I have several questions, here goes:
    1. Is there any book/tutorial/whitepaper out there that describes building an ecommerce site using Oracle 10G/9I/8I? Just some examples as how to make the datamodel regarding the shopping basket etc.
    2. I prefer DreamWeaver as it let's me make nice looking css style based pages without throttling too much through the code. Are there Oracle tools which allow me to make an advanced nice looking ecommerce site?
    I hope some of you can help me get started. Any effort is appreciated.
    Cheers

    I'm new to using Oracle 10G. After reviewing several rdms's I've picked Oracle 10G as my rdms. I'm trying to build an ecommerce site using DreamWeaver MX 2004 and Oracle 10G. The website will be selling hardware and software products. I have a choice in DreamWeaver to go for a .asp or .jsp setup. I have several questions, here goes:
    1. Is there any book/tutorial/whitepaper out there that describes building an ecommerce site using Oracle 10G/9I/8I? Just some examples as how to make the datamodel regarding the shopping basket etc.
    2. I prefer DreamWeaver as it let's me make nice looking css style based pages without throttling too much through the code. Are there Oracle tools which allow me to make an advanced nice looking ecommerce site?
    I hope some of you can help me get started. Any effort is appreciated.
    Cheers

  • How do I use the J2EE EJB container with the FULL version of Tomcat

    The version of Tomcat integrated in J2EE is really cut-down. I want to be able to run the standard Tomcat 4.0.1 to give the full JSP facilities, but I also want to be able to use EJBs from the J2EE.
    If I copy the j2ee.jar, j2ee-ri-svc.jar and home interface to the "lib" directory they do not appear to be loaded, as I cannot resolve the javax.ejb.EJBHome.class.
    If I copy the same library into the application's WEB-INF/lib directory then the naming jaxax.naming.InitialContext gives a context without the java:/comp/env entries.
    I do not want to use another EJB contrainer after having got used to deploying apps with J2EE.
    If anyone can help I would be greatful, and post a thanks message with duke dollars!
    Chris
    10 Duke Dollars available

    I have done it before and basically it is not that difficult, but in practice not that easy ;-)
    All you need to do is see Tomcat as a client to the EJBs. This means deploying the application in two parts: the webapp as a WAR to Tomcat 4.0.1, and the EJBs to J2EE. Both running and started independantly.
    This ofcourse means that the WAR file must have the stubs of the EJBs to be able to communicate and access to j2ee.jar to get the InitialContext.
    So:
    - compile the EJBs
    - create the EAR (containing only EJBs)
    - deploy the EAR
    - copy the stubs to the libs directory of the webapp
    - compile the webapp
    - create the WAR
    - deploy the WAR
    Off you go.
    Tom

  • How to use embeddable EJB container (Java EE 6 / EJB 3.1) on Mac OS?

    To my understanding, the intent of the embeddable EJB 3.1 container is - among others - to support out-of-container testing. I've created a JUnit test case that uses glassfish embeddable for integration testing of ejb 3.1 Light ejbs. I run the tests using Maven.
    I have one general problem and one problem specific to Mac OS (I'm not able to use the embeddable container at all on Mac OS).
    1. First the general problem: the ejb container does not inject or publish classes that are on the test class-path only:
    src>main>java>MyEjb.class
    src>test>java>MyTestEjb.class
    The test case looks like this:
    public class TestCase1b {
         static EJBContainer container;
         @BeforeClass
         public static void initEjbContainer() {
              container = EJBContainer.createEJBContainer();
              for ( Object property : System.getProperties().keySet() ) {
              System.out.print(property + " : ");
              System.out.println(System.getProperty((String)property));
         @Test
         public void canTestWithTransaction() throws NamingException, NotSupportedException, SystemException {
              Context ctx = container.getContext();
              OrderServiceTesterEjb orderServiceTester = (OrderServiceTesterEjb) ctx
                        .lookup("java:global/classes/OrderServiceTesterEjb");
              Assert.assertNotNull(orderServiceTester.testCreateOrderWithTransaction());
         @AfterClass
         public static void closeEjbContainer() {
              container.close();
    The idea with a test-ejb is to mimic the way I typically perform junit integration testing with Spring: the test database i preloaded with test data. Each test-method of the junit test case starts a transaction, invokes the service, evaluates the state of the database and finally performs a rollback. My idea was to mimic that by creating a test ejb (Stateless, REQUIRES_NEW), that injects the EJB to test, calls the method to test, evaluates the result or db state and finally sets rollbackonly before returning. The problem is that the test case can lookup ejbs in src/main/java, but not the "test" ejbs in src/test/java. My workaround is to include the test-EJBs in src/main/java which I think is not acceptable.
    2. Next the Mac-problem:
    The Mac OS JDK 1.6 contains version 1.0 of javax.annotation (jsr 250). EJBs developed with Java EE 6 depends on version 1.1 of javax.annotation. Specifically, one typically need @Resource(lookup=... and @DataSourceDefinition of javax.annotation.sql which are both missing in the JDK. I can compile my EJBs by adding the javaee-api-6.0.jar library to my classpath. But when running unit tests with maven (as described above), a runtime error is reported, stating that the lookup-property of the @Resource annotation is undefined. This is logical, since the boot classpath should have precedence. So I added javaee-api-6.0.jar to the lib/endorsed directory of the jre. Unfortunetely, this triggers a segmentation fault of the Mac OS JVM when running the test. I have no other workaround than switching to windows. Any help / hints are much appreciated.
    /Johan

    Just as an update, we're soon to release the WLS 11g R1 PS2 update, which will contain WLS 10.3.3 just to confuse things.
    As part of that, we're distributing for the first time, an additional .zip version of WLS to make it easier for developers.
    The zip file distribution has no GUI installer -- it's a simple case of unzip, run a script it provides, then start the server.
    The zip file distribution has been specifically tested on Mac OS X and the WLS config/domain scripts automatically adjust as necessary for the Mac OS X java environment.
    Once the zip file distribution is available, we hope that developing against WLS on Mac OS X (and Windows/Linux) will be an easier task.
    -steve-

  • Out of memory using Windows Server 2003 and Oracle 9.2.0.3

    Hi,
    I just installed both Windows Server 2003 and Oracle 9.2.0.3. The server I am using has 4 gigabytes of memory installed, and windows shows that to be the actual physical memory on the server. The paging file is 8 gigabytes for a total of 12 gigabytes of virtual memory.
    Using the Oracle Database Configuration Assistant, I create a new database using default values. After verifying the installation worked OK (database started, queries ran), I attempted to change some of the memory parameters and was able to start the database using about 1.4 gigabytes of total SGA, with the O/S using about .3 gigabytes for a total of 1.7 gigabytes. I then attempted to change the buffer cache + 1 gigabyte for a total of 2 gigabytes. Now the database will not start and I get an out of memory error ora-27102 with an additional O/S memory error of "O/S Error: (OS 8) Not enough storage is available to process this command".
    So, I have two problems:
    1) With 4 gigabytes installed, and the O/S using only about 300 megabytes, why isn't Oracle able to take advantage of the memory on this machine past the 1.7 gigabytes (as reported by Windows task manager).
    2) How do I change the spfile memory parameters so the database will start using spfile? I can start the database pointing to a pfile with lesser memory parameters, but I don't know how to effect change on the spfile, since I cannot start with the spfile.
    Both these technologies (9.2.0.3 and Server 2003) are new to me, so any insight would be appreciated!
    HERE ARE THE SPFILE PARAMETERS THAT WORKED:
    SGA (M)
    Shared Pool=104
    Buffer Cache=960 ***
    Large Pool=0
    Java Pool=64
    Total SGA=1128
    SGA Max Size=1321
    Aggregate PGA Target=1500
    Current PGA Allocated=22868KB
    WINDOWS MEMORY INFO FROM TASK MANAGER SHOW:
    PF Usage=1.66GB
    Physical Memory (K)
    Total=4062704
    Available=3203460
    System Cache=2499096
    Commit Charge (K)
    Total=1748184
    Limit=12288628
    Peak=1925276
    *** When I change this to 2048 the database did not start.
    Thank you.

    CREATE SPFILE
    Purpose
    Use the CREATE SPFILE statement to create a server parameter file from a client-side initialization parameter file. Server parameter files are binary files that exist only on the server and are called from client locations to start up the database.
    Server parameter files let you make persistent changes to individual parameters. When you use a server parameter file, you can specify in an ALTER SYSTEM SET parameter statement that the new parameter value should be persistent. This means that the new value applies not only in the current instance, but also to any instances that are started up subsequently. Traditional client-side parameter files do not let you make persistent changes to parameter values. Because they are located on the server, these files allow for automatic database tuning by Oracle and for backup by Recovery Manager (RMAN).
    To use a server parameter file when starting up the database, you must create it from a traditional text initialization parameter file using the CREATE SPFILE statement.
    All instances in an Real Application Clusters environment must use the same server parameter file. However, when otherwise permitted, individual instances can have different settings of the same parameter within this one file. Instance-specific parameter definitions are specified as SID.parameter = value, where SID is the instance identifier.
    The method of starting up the database with a server parameter file depends on whether you create a default or nondefault server parameter file. Please refer to "Creating a Server Parameter File: Examples" for examples of how to use server parameter files.
    See Also:
    CREATE PFILE for information on creating a regular text parameter file from a binary server parameter file
    Oracle9i Database Administrator's Guide for information on pre-Oracle9i initialization parameter files and Oracle9i server parameter files
    Oracle9i Real Application Clusters Administration for information on using server parameter files in a Real Application Clusters environment
    Prerequisites
    You must have the SYSDBA or the SYSOPER system privilege to execute this statement. You can execute this statement before or after instance startup. However, if you have already started an instance using spfile_name, you cannot specify the same spfile_name in this statement.
    Syntax
    create_spfile::=
    Text description of create_spfile
    Semantics
    spfile_name
    This clause lets you specify a name for the server parameter file you are creating.
    If you do not specify spfile_name, Oracle uses the platform-specific default server parameter filename. If spfile_name already exists on the server, this statement will overwrite it. When using a default server parameter file, you start up the database without referring to the file by name.
    If you do specify spfile_name, you are creating a nondefault server parameter file. In this case, to start up the database, you must first create a single-line traditional parameter file that points to the server parameter file, and then name the single-line file in your STARTUP command.
    See Also:
    "Creating a Server Parameter File: Examples" for information on starting up the database with default and nondefault server parameter files
    Oracle9i Database Administrator's Guide for Windows (or other appropriate operating system specific documentation) for default parameter file names
    pfile_name
    Specify the traditional initialization parameter file from which you want to create a server parameter file.
    If you specify pfile_name, the parameter file must reside on the server. If it does not reside in the default directory for parameter files on your operating system, you must specify the full path.
    If you do not specify pfile_name, Oracle looks in the default directory for parameter files on your operating system for the default parameter filename, and uses that file. If that file does not exist in the expected directory, Oracle returns an error.
    Note:
    In a Real Application Clusters environment, you must first combine all instance parameter files into one file before specifying it in this statement to create a server parameter file. For information on accomplishing this step, see Oracle9i Real Application Clusters Setup and Configuration.
    Examples
    Creating a Server Parameter File: Examples
    The following example creates a default server parameter file from a client initialization parameter file named t_init1.ora:
    CREATE SPFILE
    FROM PFILE = '$ORACLE_HOME/work/t_init1.ora';
    Note:
    Typically you will need to specify the full path and filename for parameter files on your operating system. Please refer to your Oracle operating system documentation for path information.
    When you create a default server parameter file, you subsequently start up the database using that server parameter file by using the SQL*Plus command STARTUP without the PFILE parameter, as follows:
    STARTUP
    The following example creates a nondefault server parameter file s_params.ora from a client initialization file named t_init1.ora:
    CREATE SPFILE = 's_params.ora'
    FROM PFILE = '$ORACLE_HOME/work/t_init1.ora';
    When you create a nondefault server parameter file, you subsequently start up the database by first creating a traditional parameter file containing the following single line:
    spfile = 's_params.ora'
    The name of this parameter file must comply with the naming conventions of your operating system. You then use the single-line parameter file in the STARTUP command. The following example shows how to start up the database, assuming that the single-line parameter file is named new_param.ora:
    STARTUP PFILE=new_param.ora
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_616a.htm#SQLRF01315
    Joel P�rez

  • Help!.... XA error: using Weblogic 6.1 and Oracle 8.1.6

              Hi,
              I am using Weblogic 6.1 with Oracle 8.1.7. I configured a TXDataSource as I wanted
              to use Container Managed Transaction through a Session Bean.
              Connection Pool Settings: -------------------------
              Name - myXAPool URL - jdbc:oracle:thin:@myServer:1521:myDb DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
              TXDataSource Settings : -----------------------
              Name - myXADS
              JNDIName - myXADS
              PoolName - myXAPool
              Everything works fine but once in a while I get the following exception:
              java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured
              in the transaction branch start() failed on resource 'myXAPool' Unexpected error
              during start for XAResource 'myXAPool': null
              The connection pool size is 30 and the number connections high reached was 5,
              which means there are enough connections in the pool available at all time.
              It would be really great if you can help me out.
              Thanks in Advance, Sudhir.
              

    Hi Slava,
    Sorry about that Oracle instance I am using is 8.1.7.
    For the XA Driver I am using the one that comes with Weblogic in weblogic.jar.
    And my Weblogic version 6.1 Sp3.
    Thanks,
    Sudhir.
    "Slava Imeshev" <[email protected]> wrote:
    Hi Sudhir,
    Are you using an instance of 8.1.6 or 8.1.7? In the message header you
    say
    8.1.6.
    Regards,
    Slava Imeshev
    "Sudhir Babu" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I am using Weblogic 6.1 with Oracle 8.1.7. I configured a TXDataSourceas
    I wanted
    to use Container Managed Transaction through a Session Bean.
    Connection Pool Settings: -------------------------
    Name - myXAPool URL - jdbc:oracle:thin:@myServer:1521:myDb
    DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
    TXDataSource Settings : -----------------------
    Name - myXADS
    JNDIName - myXADS
    PoolName - myXAPool
    Everything works fine but once in a while I get the following exception:
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager errorhas
    occured
    in the transaction branch start() failed on resource 'myXAPool' Unexpectederror
    during start for XAResource 'myXAPool': null
    The connection pool size is 30 and the number connections high reachedwas
    5,
    which means there are enough connections in the pool available at alltime.
    It would be really great if you can help me out.
    Thanks in Advance, Sudhir.

  • XA error: using Weblogic 6.1 and Oracle 8.1.6

    Hi,
    I am using Weblogic 6.1 with Oracle 8.1.7. I configured a TXDataSource as I wanted
    to use Container Managed Transaction through a Session Bean.
    Connection Pool Settings: -------------------------
    Name - myXAPool URL - jdbc:oracle:thin:@myServer:1521:myDb
    DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
    TXDataSource Settings : -----------------------
    Name - myXADS
    JNDIName - myXADS
    PoolName - myXAPool
    Everything works fine but once in a while I get the following exception:
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured
    in the transaction branch start() failed on resource 'myXAPool' Unexpected error
    during start for XAResource 'myXAPool': null
    The connection pool size is 30 and the number connections high reached was 5,
    which means there are enough connections in the pool available at all time.
    It would be really great if you can help me out.
    Thanks in Advance, Sudhir.

    Hi Slava,
    Sorry about that Oracle instance I am using is 8.1.7.
    For the XA Driver I am using the one that comes with Weblogic in weblogic.jar.
    And my Weblogic version 6.1 Sp3.
    Thanks,
    Sudhir.
    "Slava Imeshev" <[email protected]> wrote:
    Hi Sudhir,
    Are you using an instance of 8.1.6 or 8.1.7? In the message header you
    say
    8.1.6.
    Regards,
    Slava Imeshev
    "Sudhir Babu" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I am using Weblogic 6.1 with Oracle 8.1.7. I configured a TXDataSourceas
    I wanted
    to use Container Managed Transaction through a Session Bean.
    Connection Pool Settings: -------------------------
    Name - myXAPool URL - jdbc:oracle:thin:@myServer:1521:myDb
    DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
    TXDataSource Settings : -----------------------
    Name - myXADS
    JNDIName - myXADS
    PoolName - myXAPool
    Everything works fine but once in a while I get the following exception:
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager errorhas
    occured
    in the transaction branch start() failed on resource 'myXAPool' Unexpectederror
    during start for XAResource 'myXAPool': null
    The connection pool size is 30 and the number connections high reachedwas
    5,
    which means there are enough connections in the pool available at alltime.
    It would be really great if you can help me out.
    Thanks in Advance, Sudhir.

  • Where to put utility jar (used by EJB's and war)

    Hello all,
    In many cases when you create a web application including EJB's and a WAR file packaged together in an EAR file, you need some utility classes that are used in the EJB's as wel as in the servlets in the WAR. The utility classes might for example be value object classes that servlets use to exchange data with te EJB's.
    My question is: What is the best place to put the utility class files?
    There is a new article on JDC: http://developer.java.sun.com/developer/technicalArticles/J2EE/build/ that gives some tips. For example, it proposes to put the utility JAR in the EAR file and then add a "Class-Path:" entry to the MANIFEST.MF of the EJB's that use the utility classes.
    However, this approach does not work on BEA Weblogic 6.0. Weblogic's classloader just seems to ignore the "Class-Path:" in the EJB JAR's manifest.
    Any thoughts?
    regards
    Jesper

    The "CLASS-PATH" mechanism in that article is a new
    requirement in J2EE 1.3 (final draft 4). Therefore
    right now Weblogic does not support it yet. Now you
    need to put those utility classes in both the WAR (in
    WEB-INF/lib) and EJB JAR files. If you really want
    only 1 copy of the jar file deployed, you can manually
    add that jar file to weblogic server classpath in the
    start script under config/yourdomain.HI all,
    I have some Utility jar file for EJB and Web Application,
    In the second solution about one copy in weblogic,
    I tried it in the WLS60 it's ok
    But it didn't work in WLS61
    Anyone could give me any good suggestion?
    Moen

  • J2ee naming services and Oracle 9iAS

    I am trying to use the JNDI services of the j2ee specs with JDeveloper and the Oracle Application server (9iAs). Doing this we have the problem that JDeveloper do not support the java.naming package. We have added the package to JDeveloper but we do not know ik Oracle 9iAs will work with this package added.
    Can someone give me some information about the use of JNDI within JDeveloper and Oracle 9iAs
    null

    I am trying to use the JNDI services of the j2ee specs with JDeveloper and the Oracle Application server (9iAs). Doing this we have the problem that JDeveloper do not support the java.naming package. We have added the package to JDeveloper but we do not know ik Oracle 9iAs will work with this package added.
    Can someone give me some information about the use of JNDI within JDeveloper and Oracle 9iAs
    null

  • How to connect using netbean 6.5 and oracle lite 10g

    Hello everyone.. I am really really new in this kind of thing. My task is that I need to develop a simple system using netbean and oracle lite 10g..Does anyone can at least give me a little bit tutorial for a head start in order to connect them.. I really appreciate for those who answer this.. Thank you guys...

    you mean to connect from java to oracle lite server or client?
    -if it is server you mean then you probably need to run some oracle apis (e.g. the consolidator aps).
    String url="MOBILEADMIN/123@jdbc:oracle:thin:@MYSERVER:1521:MYDB" ;
    ResourceManager.initialize(url);
    rm = ResourceManager.getInstance();
    User usr = rm.getUser(user);
    for (Enumeration e = usr.getDevices(); e.hasMoreElements();) {
    Device dev = (Device)e.nextElement();
    }//AND you may continue from here in order to send commands to the devices
    -if you have a oracle repository at the back end and you want to connect to that then you can connect like:
    DriverManager.registerDriver ((Driver)Class.forName ("oracle.jdbc.driver.OracleDriver").newInstance ());
    String url="jdbc:oracle:thin:@myserver:port:database;
    c=DriverManager.getConnection( url,"username", "password" );
    s=c.createStatement();
    s.executeQuery("Select TRIM(CODES) AS CODES,TRIM(SURNAME)||'_'||TRIM(FIRSTNAME) AS NAME from MYDB.USERS");
    ResultSet rs =s.getResultSet();
    -now if you want to connect to the oracle lite client database then you may connect using the polite
    you should write something like (i havent tried it because i use handheld clients)
    String ConnectMe=("jdbc:polite:SCOTT/tiger:polite;DataDirectory=c:\Oracle_Home;Database=polite;IsolationLevel=SINGLE;USER;Autocommit=ON;CursorType=DYNAMIC")
    try {
    Connection conn = DriverManager.getConnection(ConnectMe)
    catch (SQLException e)
    (check the internet for jdbc:polite connection strings)
    gl

  • How to create two level dynamic list using JSP , Java Script and Oracle

    I am new in JSP. And i am facing problem in creating two level dynamic list using JSP ,Java Script where the listdata will come from Oracle 10g express edition database. Is there any easy way in JSP that is available on in ASP.NET.
    Plz response with details.

    1) Learn JDBC API [http://java.sun.com/docs/books/tutorial/jdbc/index.html].
    2) Create DAO class which contains JDBC code and do all SQL queries and returns or takes ID's or DTO objects.
    3) Learn Servlet API [http://java.sun.com/javaee/5/docs/tutorial/doc/].
    4) Create Servlet class which calls the DAO class, gets the list of DTO's as result, puts it as a request attribute and forwards the request to a JSP page.
    5) Learn JSP and JSTL [http://java.sun.com/javaee/5/docs/tutorial/doc/]. Also learn HTML if you even don't know it.
    6) Create JSP page which uses the JSTL c:forEach tag to access the list of DTO's and iterate over it and prints a HTML list out.
    You don't need Javascript for this.

  • Use of SQL Server and Oracle Simultaneously

    Hello,
    Is it possible to have Oracle and SQL Server used simultaneously? Here, developers will be accessing both databases at the same time, whereas they are some ease of implementations at one Database, which can't be found in another database.
    Regards,

    user650358 wrote:
    I am able to retrieve with simple OUT Parameters from the stored procedure in the application without having to use refcursor. Is this a bad thing in the use of other data types instead of refcursors?
    I was able to have only a varchar and this worked fine.PL/SQL is a formal procedural language with a number of object orientated programming features. Of course functions can return all kinds of data types - even objects and arrays and collections and pointers (called LOB locators).
    All SQL in Oracle are parsed and stored in the server as cursors. The ref cursor data type in PL/SQL is a variable type that contains the handle of a cursor in the server - its "special ability" is passing this PL/SQL variable structure to a client (like Java or .Net) and have the client consume the output of the cursor.
    Ref cursors allow you to move a lot of business logic and validation and processing into PL/SQL - and have PL/SQL do the complex stuff and create the SQL cursor and then simply pass the cursor handle to the client as a ref cursor data type. You can easily maintain this code, introduces changes, tune for performance, without having to touch a single byte of client code.
    But functions are not there simply to pass ref cursor handles to a client. They can do various other stuff and return all kinds of data types and structures.

  • App developed using Jdev 3.2 and oracle 9.2: oracle internal error

    Good morning,
    I have developed a JSP application using Jdeveloper 3.2.3.
    Everything works fine under Oracle 8.x.
    One of our customers, a few days ago, decided to migrate to oracle 9.2, but he can't use our application anymore, because every time a javabean accesses the database, Oracle returns:
    ORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []
    What I should do, in order to let my customer use my JSP application under any ctual version of Oracle?
    1) Have I to install a newer version of Jdeveloper and simply recompile my application?
    2) Have I to download a special package to deliver to the customer using Oracle 9.2?
    3) Anything else?
    Thank you for your advices.

    Giambattista,
    Check your JDBC driver version.
    You will get this ORA-600:[ttcgcshnd-1] error if you have the JDBC driver 8.1.7.1 or earlier, and you try to connect to an Oracle 9.0.1 or later database.
    So, your app will work when connected to an Oracle8i database, but fail when trying to Oracle9i.
    The solution is to upgrade to the patched 8.1.7.2 JDBC driver, or better yet, use the latest JDBC driver that comes with JDeveloper 9.0.3 (which is JDBC 9.0.1 version).

  • BLOB insert behavior with thin driver using standard JDBC2.0 and ORACLE-JDBC2.0API

    We have a problem with a BLOB insert to an oracle 8.1.7 DB using Oracle 8.1.7 JDBC thin driver.We get socket read/write error after inserting 32k of data using the standard JDBC2.0 API but using the Oracle JDBC2.0API (using OracleResultSet) it goes fine. We have a requirement to use the standard JDBC2.0 so that our code works with multiple database vendors. Is there another way to get in the blob data with standard JDBC API & using thin driver...?
    thanks,
    Madhu
    Here is my sample test program that does both standard & oracle specific JDBC Blob test insert.
    import java.sql.*;
    import java.io.*;
    import oracle.sql.BLOB;
    import oracle.jdbc.driver.OracleResultSet;
    public class testBLOB {
    //trying to insert a huge file to a BLOB
    static String fileName = "/kernel/genunix";
    public static void main(String[] args) {
    String driverName = "oracle.jdbc.driver.OracleDriver";
    String dbURL = "jdbc:oracle:thin:@localhost:1521:test"; //thin driver
    String user = "BlobTest";
    String passwd = "BlobTest";
    Connection con=null;
    try {
    Class.forName(driverName);
    con=DriverManager.getConnection(dbURL, user,passwd);
    catch (Exception e) {
    e.printStackTrace();
    close(con);
    int i = 0;
    while (i < args.length) {
    if (args.equals("-f"))
    fileName = args[++i];
    i++;
    System.out.println("The file being Stored is: "+fileName);
    createTable(con);
    insertUsingOracleAPI(con);
    insertUsingJDBC20API(con);
    //readDB(con);
    static String getFileName() {
    return fileName;
    public static void close(Connection con) {
    try {
    if (con != null) {
    con.close();
    catch (Exception e) {
    System.exit(-1);
    public static void createTable(Connection con) {
    Statement stmt ;
    try {
    stmt = con.createStatement();
    stmt.execute("DROP TABLE basic_blob_table");
    stmt.close();
    catch (SQLException sqlEx) {
    System.out.println("Dropped the Table");
    try {
    stmt = con.createStatement();
    stmt.execute("CREATE TABLE basic_blob_table ( x varchar2(30), b blob)");
    stmt.close();
    catch (SQLException sqlEx) {
    sqlEx.printStackTrace();
    close(con);
    System.out.println("Created the Table");
    public static void insertUsingOracleAPI(Connection con) {
    OutputStream os = null;
    Statement stmt = null;
    ResultSet rs = null;
    FileInputStream is = null;
    try {
    con.setAutoCommit(false);
    stmt = con.createStatement();
    stmt.execute("INSERT INTO basic_blob_table VALUES( 'OracleAPI', empty_blob())");
    System.out.println("Inserted the dummy Row");
    rs = stmt.executeQuery("Select * from basic_blob_table where x='OracleAPI'");
    if (rs != null && rs.next()) {
    BLOB blob = ((OracleResultSet)rs).getBLOB(2);
    File file = new File(getFileName());
    is = new FileInputStream(file);
    os = blob.getBinaryOutputStream();
    byte[] chunk = new byte[1024];
    int length = -1;
    while((length = is.read(chunk)) != -1)
    os.write(chunk, 0,length);
    System.out.println("Inserted the File " + getFileName() );
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    if (os != null) {
    os.flush();
    os.close();
    if (is != null)
    is.close();
    stmt.close();
    con.commit();
    con.setAutoCommit(true);
    catch (Exception e) {}
    public static void insertUsingJDBC20API(Connection con) {
    PreparedStatement stmt = null;
    FileInputStream is = null;
    try {
    stmt = con.prepareStatement("INSERT INTO basic_blob_table VALUES(?,?)");
    File file = new File(getFileName());
    is = new FileInputStream(file);
    stmt.setString(1,"JDBC20API");
    stmt.setBinaryStream(2,is,(int)file.length());
    stmt.executeUpdate();
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    if (is != null)
    is.close();
    stmt.close();
    catch (Exception e) {}
    null

    Thanks for the response.
    I understand what you are saying...
    that readers don't block writers in Oracle (the same is true in SQL Server 2000).
    However, I don't see how my test case is working correctly with Oracle (the exact same code acting as I'm thinking it should with SQL Server, but I still think it is acting incorrectly with Oracle).
    I have transaction A do this:
    update <table> set <column2>=<value> where <column1>='1'
    then I use Thread.sleep() to make that program hang around for a few minutes.
    Meanwhile I sneak off and start another program which begins transaction B. I have transaction B do this:
    select * from <table> where <column1>='1'
    and the read works immediately (no blocking... just as you have said) however, transaction A is still sleeping, it has not called commit() or rollback() yet.
    So what if transaction A were to call rollback(), the value read by transaction B would be incorrect wouldn't it ?
    Both A and B use setAutoCommit(false) to start their transactions, and then call setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED).
    Isn't that supposed to guarantee that a reader can only read what is committed ?
    And if a row is in "flux"... in the process of having one or more values changed, then the database cannot say what the value will be ?
    I can almost see what you are saying.
    In letting the reader have what it wants without making it wait, I suppose it could be said that Oracle is holding true to the "only let committed data be read"
    So if that's it, then what if I want the blocking ?
    I want an entire row to be locked until whoever it in the middle of updating, adding, or removing it has finished.
    Do you know if that can be done with Oracle ? And how ?
    Thanks again for helping me.

Maybe you are looking for