Thin Oracle

hello all experts,
I have some java code of a GUI application that have database connection using the Thin Oracle driver. The main method looks like this:
// Main Method
public static void main( String[] args )
String strProp = null;
NHProps nhProps = null;
NHLoginDialog nhLogDlg = null;
nhProps = new NHProps( ClassLoader.getSystemResource( "props.txt" ) );
strProp = System.getProperty( "database.url" );
if( strProp == null )
strProp = "jdbc:oracle:thin:@T2DEVELOPMENT:1521:T2D";
// strProp = "jdbc:oracle:thin:@T2PRODUCTION:1521:T2";
nhLogDlg = new NHLoginDialog( strProp,
new NHLoginListener()
public void updateConnection( Connection con,
NHLoginDialog nhLogin )
nhLogin.setCursor( new Cursor( Cursor.WAIT_CURSOR ) );
try
dbInst.conn = con;
dbInst.conn.setAutoCommit( true );
ValGui applet = new ValGui();
applet.setSize(800,600);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
applet.setLocation((d.width - applet.getSize().width) / 2, (d.height - applet.getSize().height) / 2);
applet.setTitle("Talisman II - Statement Validator. For period "+dateCalc.fromDate+" to "+dateCalc.toDate);
nhLogin.setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );
nhLogin.setVisible( false );
applet.setSplash();
catch( Exception exp )
System.out.println( "Main ERROR: " + exp );
}, "Norton Healthcare" );
nhLogDlg.setVisible( true );
What I want to do is to run the application without the database. (I don't have Oracle installed too). I tried to set the "strProp" to null. But it gave me a java.lang.NullPointerException.
Can someone tell me how I can run it without the database?
Thanks alot.

Oh god help me....This is what I get if I put exp.printStackTrace(); into the code (and maybe more of these at the top but I can't copy them down):
at java.awt.Component.processMouseEvent(Component.java:5134)
at java.awt.Component.processEvent(Component.java:4931)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3639)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1590)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Thanks for all your patient help!
Really thanks alot!

Similar Messages

  • Issue encountered when Login as sysdba role using Thin Oracle JDBC Driver

    Hello all,
    we are now considering to use Thin oracle JDBC driver to create database in our project, but we met one issue when we tried to connect to oracle as sysdba role using Thin driver, and it throws java.sql.SQLException: Io Exception: SO Exception was generated, I have found some tips on oracle jdbc website and it says :
    How do I connect as SYSDBA or SYSOPER?
    The only way to do this is to use the Properties object when connecting, rather than specifying the username and password as strings. Put the username into the "user" property, and the password into the "password" property. Then, put the mode into the "internal_logon" property. Something like the following:
    Properties props = new Properties();
    props.put("user", "scott");
    props.put("password", "tiger");
    props.put("internal_logon", "sysoper");
    Connection conn = DriverManager.getConnection (url, props);
    When connecting as SYSDBA or SYSOPER using the Thin driver, the RDBMS must be configured to use a password file. See "Creating and Maintaining a Password File" in the "Oracle Database Administrator's Guide".
    So, i did execute orapwd command to create a password file and also set remote_login_passwordfile=execlusive in my initxxx.ora initial parameter file, however, when i tried to connect, it failed.
    private static void createEmsdbDatabase(){
    String url = "jdbc:oracle:thin:@localhost:1521:";
    StringBuffer sqlStatement = new StringBuffer();
    sqlStatement.append("create database xxx");
    sqlStatement.append("maxdatafiles 254 ");
    sqlStatement.append("maxinstances 8 ");
    sqlStatement.append("maxlogfiles 32 ");
    sqlStatement.append("character set UTF8 ");
    sqlStatement.append("national character set UTF8 ");
    sqlStatement.append("DATAFILE 'c:\\oracle\\xxx\\system01.dbf' SIZE 18M REUSE ");
    sqlStatement.append("logfile 'c:\\oracle\\xxx\\redo01.log' SIZE 2M REUSE, ");
    sqlStatement.append("'c:\\oracle\\xxx\\redo02.log' SIZE 2M REUSE, ");
    sqlStatement.append("'c:\\oracle\\xxx\\redo03.log' SIZE 2M REUSE ");
    try {
    DriverManager.registerDriver(new OracleDriver());
    Properties props = new Properties();
    props.put("user", "sys");
    props.put("password", "password");
    props.put("database","xxx");
    props.put("internal_logon", "sysdba");
    Connection conn = DriverManager.getConnection(url, props);
    Statement statement = conn.createStatement();
    statement.executeUpdate(sqlStatement.toString());
    statement.close();
    conn.close();
    } catch (SQLException e) {
    e.printStackTrace();
    But what made me puzzled a lot is if i use OCI driver, it did work great, why??? guys, anybody knows, please give me some tips, thanks in advance.
    regards,
    Kaixuan @ Shanghai

    clarify my question in detail:
    Step 1 : create password file using orapwd command
    Step 2 : create database instance using oradim command
    Step 3 : login using sys as sysdba to startup database, e.g startup nomount pfile='...\initxxx.ora'
    Step 4 : create database.
    java code showing below:
    private static void createEmsdbDatabase(){
    String url = "jdbc:oracle:thin:@localhost:1521:";
    StringBuffer sqlStatement = new StringBuffer();
    sqlStatement.append("create database xxx ");
    sqlStatement.append("maxdatafiles 254 ");
    sqlStatement.append("maxinstances 8 ");
    sqlStatement.append("maxlogfiles 32 ");
    sqlStatement.append("character set UTF8 ");
    sqlStatement.append("national character set UTF8 ");
    sqlStatement.append("DATAFILE 'c:\\oracle\\xxx\\system01.dbf' SIZE 18M REUSE ");
    sqlStatement.append("logfile 'c:\\oracle\\xxx\\redo01.log' SIZE 2M REUSE, ");
    sqlStatement.append("'c:\\oracle\\xxx\\redo02.log' SIZE 2M REUSE, ");
    sqlStatement.append("'c:\\oracle\\xxx\\redo03.log' SIZE 2M REUSE ");
    try {
    DriverManager.registerDriver(new OracleDriver());
    Properties props = new Properties();
    props.put("user", "sys");
    props.put("password", "password");
    props.put("database","xxx");
    props.put("internal_logon", "sysdba");
    Connection conn = DriverManager.getConnection(url, props);
    Statement statement = conn.createStatement();
    statement.executeUpdate(sqlStatement.toString());
    statement.close();
    conn.close();
    } catch (SQLException e) {
    e.printStackTrace();
    issue was met here, when i tried to login as sysdba using sys, and in my java code, i use Thin driver, it then thrus exception, but when OCI driver is used, it works great, i don't know why.
    that is, when i use "jdbc:oracle:oci8:@" as database URL and then properties.put("database","xxx"), it works great. but, when i use "jdbc:oracle:thin:@localhost:1521:" as database URL and then properties.put("database","xxx"), it failed. hopefully, i have clarified my question clearly. thanks.

  • Best Practice for thinning Oracle Forms

    We are considering upgrading from 10g (10.1.2.3) to (probably) 11g forms initially whist long term migrating to ADF.
    Our system is 15 years old and has many issues that go along with a system this old i.e. database keys/indexes missing, forms with lots of code etc.
    We have very few resources so thought the best way to go about this would be to thin out all our Oracle forms in 10g prior to upgrade (as this is mainly just a recompile in 11g) but was looking at if there were any best practices as to what level this should be done.
    For example we heavily use PLLs. Should the majority of this code be moved into packages or are PLLs ok to use. I take it the majority of program units should be moved to db.
    How thin should we aim to make the form. i.e if we are using post queries for something as simple as select customername into :nondbitem from customer where customerid =:customerid. Should we be making this a function in the db and reusing the code in the necessary places?
    Just wondering what people would deam best practice before we start.
    Thanks

    Thanks for all your input.
    Although the current database design is not correct we are going to correct the existng database rather than rewriting it.
    So were hoping to correct this also!
    But what im doing now to get rid some of this post queries for nondbnames is im creating a view of all information i need to display on one pertaining record.
    Then i used this view like block basic procedure like relationship to the transactional block.So if you make queries or insert (need to run query the block view) it will give all the necessary record display"
    {CODE}
    This sounds sensible but we havs hundreds of tables with lots of columns. How are you managing the views/deciding how manytables/columns to include on the forms?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Bug in Oracle JDBC thin driver (parameter order)

    [ I'd preferably send this to some Oracle support email but I
    can't find any on both www.oracle.com and www.technet.com. ]
    The following program illustrates bug I found in JDBC Oracle thin
    driver.
    * Synopsis:
    The parameters of prepared statement (I tested SELECT's and
    UPDATE's) are bound in the reverse order.
    If one do:
    PreparedStatement p = connection.prepareStatement(
    "SELECT field FROM table WHERE first = ? and second = ?");
    and then bind parameter 1 to "a" and parameter to "b":
    p.setString(1, "a");
    p.setString(2, "b");
    then executing p yields the same results as executing
    SELECT field FROM table WHERE first = "b" and second = "a"
    although it should be equivalent to
    SELECT field FROM table WHERE first = "a" and second = "b"
    The bug is present only in "thin" Oracle JDBC driver. Changing
    driver to "oci8" solves the problem.
    * Version and platform info:
    I detected the bug using Oracle 8.0.5 server for Linux.
    According to $ORACLE_HOME/jdbc/README.doc that is
    Oracle JDBC Drivers release 8.0.5.0.0 (Production Release)
    * The program below:
    The program below illustrates the bug by creating dummy two
    column table, inserting the row into it and then selecting
    the contents using prepared statement. Those operations
    are performed on both good (oci8) and bad (thin) connections,
    the results can be compared.
    You may need to change SID, listener port and account data
    in getConnecton calls.
    Sample program output:
    $ javac ShowBug.java; java ShowBug
    Output for both connections should be the same
    --------------- thin Driver ---------------
    [ Non parametrized query: ]
    aaa
    [ The same - parametrized (should give one row): ]
    [ The same - with buggy reversed order (should give no answers):
    aaa
    --------------- oci8 driver ---------------
    [ Non parametrized query: ]
    aaa
    [ The same - parametrized (should give one row): ]
    aaa
    [ The same - with buggy reversed order (should give no answers):
    --------------- The end ---------------
    * The program itself
    import java.sql.*;
    class ShowBug
    public static void main (String args [])
    throws SQLException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    System.out.println("Output for both connections should be the
    same");
    Connection buggyConnection
    = DriverManager.getConnection
    ("jdbc:oracle:thin:@localhost:1521:ORACLE",
    "scott", "tiger");
    process("thin Driver", buggyConnection);
    Connection goodConnection
    = DriverManager.getConnection ("jdbc:oracle:oci8:",
    "scott", "tiger");
    process("oci8 driver", goodConnection);
    System.out.println("--------------- The end ---------------");
    public static void process(String title, Connection conn)
    throws SQLException
    System.out.println("--------------- " + title + "
    Statement stmt = conn.createStatement ();
    stmt.execute(
    "CREATE TABLE bug (id VARCHAR(10), val VARCHAR(10))");
    stmt.executeUpdate(
    "INSERT INTO bug VALUES('aaa', 'bbb')");
    System.out.println("[ Non parametrized query: ]");
    ResultSet rset = stmt.executeQuery(
    "select id from bug where id = 'aaa' and val = 'bbb'");
    while (rset.next ())
    System.out.println (rset.getString (1));
    System.out.println("[ The same - parametrized (should give one
    row): ]");
    PreparedStatement prep = conn.prepareStatement(
    "select id from bug where id = ? and val = ?");
    prep.setString(1, "aaa");
    prep.setString(2, "bbb");
    rset = prep.executeQuery();
    while (rset.next ())
    System.out.println (rset.getString (1));
    System.out.println("[ The same - with buggy reversed order
    (should give no answers): ]");
    prep = conn.prepareStatement(
    "select id from bug where id = ? and val = ?");
    prep.setString(1, "bbb");
    prep.setString(2, "aaa");
    rset = prep.executeQuery();
    while (rset.next ())
    System.out.println (rset.getString (1));
    stmt.execute("DROP TABLE bug");
    null

    Horea
    In the ejb-jar.xml, in the method a cursor is closed, set <trans-attribute>
    to "Never".
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name></ejb-name>
    <method-name></method-name>
    </method>
    <trans-attribute>Never</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    Deepak
    Horea Raducan wrote:
    Is there a known bug in Oracle JDBC thin driver version 8.1.6 that would
    prevent it from closing the open cursors ?
    Thank you,
    Horea

  • Connection reset using JDBC Oracle thin Driver (towards 10g DB)

    Hi we have a home-grown application and a Oracle 10g (10.2.0.1) database.
    We created a scheduled servlet that gets a JDBC connection from a persistent connected cache (an OracleDataSource object registered using OracleConnectionCacheManager). The servlet runs every 15 minutes and runs the query "SELECT SYSTIME FROM DUAL" on 10g Database as XYZ user. The datapool was created yday on web-app and all queries ran successfully for about 5 hours after which it reported a connection reset error.
    I can then conclude that we cannot keep the server session alive for the JDBC client by running frequent SQL queries.
    We didnt get any messages on the DB server side that indicate the release of the session
    Ultimately, we are struggling with reset connections from our applications that are
    using the JDBC thin oracle driver; after a couple of hours of idle
    connections, we receive the below error from the JDBC driver:
    Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError throwSqlException
    WARNING: DatabaseError.throwSqlException(e): Unable to find ORA number from
    exception Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError
    findMessage
    WARNING: DatabaseError.findMessage(errNum, obj): returned Io exception:
    Connection reset Jul 5, 2007 10:59:53 AM
    oracle.jdbc.driver.PhysicalConnection getWarnings
    INFO: PhysicalConnection.getWarnings()
    Any suggestions please ?
    Vk

    The code itself is fine; the problem is with one of:
    1) the connection URL
    2) intermediate networking
    3) the database itself
    1) your connection URL is "jdbc:oracle:thin:@127.0.0.1:1521:orcl"
    - is Oracle really running on the default port, 1521
    - is the installation SID really "orcl"
    2) lots of possibilities, but only a couple are likely
    - is TCP/IP configured and running on your host
    - is there a persoanl firewall rpduct running? perhaps it's blocking the connection
    3) Is Oracle running?
    Is the listener running?

  • WLS6.1, Oracle Thin XA, Oracle DB on Solaris = no dice

    I am having the exact same problem.
    The only hint to an answer I have been able to find in the WL newsgroups is
    that it may be related to a Solaris Oracle install. ????
    BEA... any ideas?
    me: WLS6.1 on W2000, Oracle 8.1.7 thin driver (tried both with and without
    the jta.zip and jndi.zip on classpath), Oracle 8.1.7 on Solaris... also
    tried with Oracle 9.0.1 (Solaris) and 9.0.1 thin driver, and 9.0.1
    thin->Oracle 8.1.7(Solaris).
    On a sidenote... I don't think you should have "ENABLE 2 PHASE COMMIT
    ACTIVE" set. According
    to the docs, this is only for drivers which need to fake 2 phase commit
    capability... the option is poorly worded in the console if this is the
    case. Regardless - I've tried with this setting both on and off and it
    doesn't make a difference.
    "Chris Baglieri" <[email protected]> wrote in message
    news:[email protected]...
    I am trying to setup two connection pools / data sources for a given
    instance of weblogic, each pointing to a different database. I would
    like to perform transactions spanning both DBs using XA. I am getting
    the following error when Weblogic starts up and tries to set up the XA
    connection pool:
    java.sql.SQLException: ORA-06550: line 1, column 14: PLS-00201:
    identifier 'JAVA_XA.XA_START' must be declared ORA-06550: line 1,
    column 8: PL/SQL: Statement ignored
    Here are the details of my XA connection pool i am trying to set up:
    Connection Pool
    NAME: warehousePool URL: jdbc:oracle:thin:@xxxxxx:1521:xxxxxx
    DRIVER: oracle.jdbc.xa.client.OracleXADataSource
    PROPERTIES: user=xxxxx password=xxxxx dll=ocijdbc8
    dataSourceName=warehousePool protocol=thin
    <JDBCConnectionPool
    CapacityIncrement="1"
    DeploymentOrder="1000"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="5"
    JDBCXADebugLevel="0"
    LoginDelaySeconds="0"
    MaxCapacity="25"
    Name="warehousePool"
    Properties="user=xxxxx;password=xxxxx;dll=ocijdbc8;dataSourceName=warehouseP
    ool;protocol=thin;url="jdbc:oracle:thin:@xxxxx:1521:xxxxx"
    RefreshMinutes="10" ShrinkPeriodMinutes="5"
    ShrinkingEnabled="true"
    SupportsLocalTransaction="false"
    Targets="DonutStoreServer"
    TestConnectionsOnRelease="false"
    TestConnectionsOnReserve="true"
    TestTableName="dual"/>
    TxDataSource
    NAME: warehousePool
    JNDI NAME: weblogic.jdbc.jts.warehousePool
    POOL NAME: warehousePool
    ENABLE 2 PHASE COMMIT ACTIVE
    <JDBCTxDataSource
    DeploymentOrder="1000"
    EnableTwoPhaseCommit="true"
    JNDIName="weblogic.jdbc.jts.warehousePool"
    Name="warehousePool"
    PoolName="warehousePool"
    Targets="DonutStoreServer"/>

    I am having the exact same problem.
    The only hint to an answer I have been able to find in the WL newsgroups is
    that it may be related to a Solaris Oracle install. ????
    BEA... any ideas?
    me: WLS6.1 on W2000, Oracle 8.1.7 thin driver (tried both with and without
    the jta.zip and jndi.zip on classpath), Oracle 8.1.7 on Solaris... also
    tried with Oracle 9.0.1 (Solaris) and 9.0.1 thin driver, and 9.0.1
    thin->Oracle 8.1.7(Solaris).
    On a sidenote... I don't think you should have "ENABLE 2 PHASE COMMIT
    ACTIVE" set. According
    to the docs, this is only for drivers which need to fake 2 phase commit
    capability... the option is poorly worded in the console if this is the
    case. Regardless - I've tried with this setting both on and off and it
    doesn't make a difference.
    "Chris Baglieri" <[email protected]> wrote in message
    news:[email protected]...
    I am trying to setup two connection pools / data sources for a given
    instance of weblogic, each pointing to a different database. I would
    like to perform transactions spanning both DBs using XA. I am getting
    the following error when Weblogic starts up and tries to set up the XA
    connection pool:
    java.sql.SQLException: ORA-06550: line 1, column 14: PLS-00201:
    identifier 'JAVA_XA.XA_START' must be declared ORA-06550: line 1,
    column 8: PL/SQL: Statement ignored
    Here are the details of my XA connection pool i am trying to set up:
    Connection Pool
    NAME: warehousePool URL: jdbc:oracle:thin:@xxxxxx:1521:xxxxxx
    DRIVER: oracle.jdbc.xa.client.OracleXADataSource
    PROPERTIES: user=xxxxx password=xxxxx dll=ocijdbc8
    dataSourceName=warehousePool protocol=thin
    <JDBCConnectionPool
    CapacityIncrement="1"
    DeploymentOrder="1000"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="5"
    JDBCXADebugLevel="0"
    LoginDelaySeconds="0"
    MaxCapacity="25"
    Name="warehousePool"
    Properties="user=xxxxx;password=xxxxx;dll=ocijdbc8;dataSourceName=warehouseP
    ool;protocol=thin;url="jdbc:oracle:thin:@xxxxx:1521:xxxxx"
    RefreshMinutes="10" ShrinkPeriodMinutes="5"
    ShrinkingEnabled="true"
    SupportsLocalTransaction="false"
    Targets="DonutStoreServer"
    TestConnectionsOnRelease="false"
    TestConnectionsOnReserve="true"
    TestTableName="dual"/>
    TxDataSource
    NAME: warehousePool
    JNDI NAME: weblogic.jdbc.jts.warehousePool
    POOL NAME: warehousePool
    ENABLE 2 PHASE COMMIT ACTIVE
    <JDBCTxDataSource
    DeploymentOrder="1000"
    EnableTwoPhaseCommit="true"
    JNDIName="weblogic.jdbc.jts.warehousePool"
    Name="warehousePool"
    PoolName="warehousePool"
    Targets="DonutStoreServer"/>

  • Problem with Oracle Thin Driver

    I use the Thin Oracle Driver (ojdbc14.jar) in my project and execute the code below.
    import java.sql.*;
    class dbAccess
         public static void main(String args[]) throws SQLException
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              Connection conn =
                   DriverManager.getConnection(
                        "jdbc:oracle:thin:@dbhost:1521:ORA1",
                        "scott",
                        "tiger");
              // @machine:port:SID,   userid,  password
              Statement stmt = conn.createStatement();
              ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
              while (rset.next())
                   System.out.println(rset.getString(1)); // Print col 1
              stmt.close();
    }But then a exception occurs: "java.sql.SQLException: E/A-Exception: The Network Adapter could not establish the connection".
    Whats wrong? Do I need to install Oracle? I didn't. I just use that jar file because I read that I don't need anything else.

    1) I never configured that url, used the class from a example.
    2) I didn't configure username / password.
    3) As I said, Oracle is not installed at all. I only use the jar file.
    I read:
    > I want to create a Java application which runs on many 400 MHz
    laptops. Do I need to install Oracle completely on all these laptops
    to use Oracle database? Or can I install a "light" version, which
    doesn't use much harddisk space, RAM and prozessor time? If yes, how
    much harddisk space, RAM and prozessor time does it cost me?
    Since you're writing a Java application, I'm assuming that you'll be
    using JDBC to connect to the database.  If so, you just need to
    download the JDBC thin driver to the client machines-- no Oracle
    software needs to be installed.What is the solution?

  • Bug in Oracle's handling of transaction isolation levels?

    Hello,
    I think there is a bug in Oracle 9i database related to serializable transaction isolation level.
    Here is the information about the server:
    Operating System:     Microsoft Windows 2000 Server Version 5.0.2195 Service Pack 2 Build 2195
    System type:          Single CPU x86 Family 6 Model 8 Stepping 10 GenuineIntel ~866 MHz
    BIOS-Version:          Award Medallion BIOS v6.0
    Locale:               German
    Here is my information about the client computer:
    Operaing system:     Microsoft Windows XP
    System type:          IBM ThinkPad
    Language for DB access: Java
    Database information:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    The database has been set up using the default settings and nothing has been changed.
    To reproduce the bug, follow these steps:
    1. Create a user in 9i database called 'kaon' with password 'kaon'
    2. Using SQL Worksheet create the following table:
    CREATE TABLE OIModel (
    modelID int NOT NULL,
    logicalURI varchar (255) NOT NULL,
    CONSTRAINT pk_OIModel PRIMARY KEY (modelID),
    CONSTRAINT logicalURI_OIModel UNIQUE (logicalURI)
    3. Run the following program:
    package test;
    import java.sql.*;
    public class Test {
    public static void main(String[] args) throws Exception {
    java.util.Locale.setDefault(java.util.Locale.US);
    Class.forName("oracle.jdbc.OracleDriver");
    Connection connection=DriverManager.getConnection("jdbc:oracle:thin:@schlange:1521:ORCL","kaon","kaon");
    DatabaseMetaData dmd=connection.getMetaData();
    System.out.println("Product version:");
    System.out.println(dmd.getDatabaseProductVersion());
    System.out.println();
    connection.setAutoCommit(false);
    connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
    int batches=0;
    int counter=2000;
    for (int outer=0;outer<50;outer++) {
    for (int i=0;i<200;i++) {
    executeUpdate(connection,"INSERT INTO OIModel (modelID,logicalURI) VALUES ("+counter+",'start"+counter+"')");
    executeUpdate(connection,"UPDATE OIModel SET logicalURI='next"+counter+"' WHERE modelID="+counter);
    counter++;
    connection.commit();
    System.out.println("Batch "+batches+" done");
    batches++;
    protected static void executeUpdate(Connection conn,String sql) throws Exception {
    Statement s=conn.createStatement();
    try {
    int result=s.executeUpdate(sql);
    if (result!=1)
    throw new Exception("Should update one row, but updated "+result+" rows, query is "+sql);
    finally {
    s.close();
    The program prints the following output:
    Product version:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    Batch 0 done
    Batch 1 done
    java.lang.Exception: Should update one row, but updated 0 rows, query is UPDATE OIModel SET logicalURI='next2571' WHERE modelID=2571
         at test.Test.executeUpdate(Test.java:35)
         at test.Test.main(Test.java:22)
    That is, after several iterations, the executeUpdate() method returns 0, rather than 1. This is clearly an error.
    4. Leave the database as is. Replace the line
    int counter=2000;
    with line
    int counter=4000;
    and restart the program. The following output is generated:
    Product version:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    Batch 0 done
    Batch 1 done
    java.sql.SQLException: ORA-08177: can't serialize access for this transaction
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796)
         at test.Test.executeUpdate(Test.java:33)
         at test.Test.main(Test.java:22)
    This is clearly an error - only one transaction is being active at the time, so there is no need for serialization of transactions.
    5. You can restart the program as many times you wish (by chaging the initial counter value first). The same error (can't serialize access for this transaction) will be generated.
    6. The error doesn't occur if the transaction isolation level isn't changed.
    7. The error doesn't occur if the UPDATE statement is commented out.
    Sincerely yours
         Boris Motik

    I have a similar problem
    I'm using Oracle and serializable isolation level.
    Transaction inserts 4000 objects and then updates about 1000 of these objects.
    Transactions sees inserted objects but cant update them (row not found or can't serialize access for this transaction are thrown).
    On 3 tries for this transaction 1 succeds and 2 fails with one of above errors.
    No other transactions run concurently.
    In read commited isolation error doesn't arise.
    I'm using plain JDBC.
    Similar or even much bigger serializable transaction works perfectly on the same database as plsql procedure.
    I've tried oci and thin (Oracle) drivers and oranxo demo (i-net) driver.
    And this problems arises on all of this drivers.
    This problem confused me so much :(.
    Maby one of Oracle users, developers nows cause of this strange behaviour.
    Thanx for all answers.

  • Thin driver 8.1.7 for HP-UX JDK 1.3.1

    Hello,
    I would like to know which is the suggested current thin driver for this environment
    HP UX
    8.1.7
    JDK 1.3.1
    and a pointer to how to get it.
    We are experience slow access to stored procedure when a high number of calls are issued concurrently and I've read that there may have been threading issues in thin oracle drivers.
    I assume these issues, if any, have been solved in the most recent versions.
    Thanks a lot.
    Franco

    I believe the one from technet was created
    under the Solaris environment. That is
    the only difference that I know of.
    null

  • JDBC on ORACLE 10 G 2: Where is the Jdbc driver?

    Hi,
    I have the JDBC tutorial working with Jdeveloper 1.3 (wich uses Java 1.5), but I would like to test a standalone java source against ORACLE 10 (wich uses Java 1.4).
    So far I have found these snippets:
    ******************** Quote 1 ***********************************************************
    // Import the JDBC classes
    import java.sql.*;
    import oracle.jdbc.pool.OracleDataSource;
    // Import the java classes used in applets
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    public class JdbcApplet extends java.applet.Applet
    implements ActionListener
    // The connect string
    static final String connect_string = "jdbc:oracle:thin:hr/hr@//localhost:1521/orcl.oracle.com";
    ****************************** End quote 1 *******************************************
    That does not compile (Java 1.4 is in PATH and CLASSPATH)
    Here is the error message:
    *************************** Quote ****************************************************
    JdbcAplaite.java:22: package oracle.jdbc.pool does not exist
    import oracle.jdbc.pool.OracleDataSource;
    ^
    JdbcAplaite.java:82: cannot resolve symbol
    symbol : class OracleDataSource
    location: class JdbcAplaite
    OracleDataSource ods = new OracleDataSource();
    ******************** End Quote *****************************************************
    This other snippet:
    ***************************** Quote 3 *************************************************
    // You need to import the java.sql package to use JDBC
    import java.sql.*;
    class Selector
    public static void main (String args [])
    throws SQLException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Connect to the database
    // You must put a database name after the @ sign in the connection URL.
    // You can use either the fully specified SQL*net syntax or a short cut
    // syntax as <host>:<port>:<sid>. The example uses the short cut syntax.
    Connection conn =
    DriverManager.getConnection ("jdbc:oracle:thin:@oracle-prod:1521:8PRD",
                        "USERNAME", "PASSWORD");
    does not work either. Error message:
    ******************************* Quote *********************************************************
    Selector.java:23: package oracle.jdbc.driver does not exist
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    ^
    1 error
    I try to locate the source generated by JDevelopper when using JDBC but I find only XML files.
    But I really need Jdbc Java 1.4 style, since I can't change PATH and CLASSPATH if I want to keep ORACLE 10 running on XP PRO.
    So I'm stuck.
    Many thanks for your help :-)

    Hi,
    I don't want to use JDeveloper.
    I want to write a Java program that connects to the database using Jdbc.
    The PATH and CLASSPATH are defined for Java 1.4.
    Here is the current CLASSPATH:
    L:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar;
    L:\oracle\product\10.2.0\db_1\jlib\orai18n.jar;.
    What "import java......." should I code?
    Many thanks.

  • Help me about oracle connect poo in wls5.1l!!

    Help!
    I can not create oracle connection pool using the following
    directive in my weblogic.properties of wls5.1:
    weblogic.jdbc.connectionPool.oraclePool=\
    url=jdbc:oracle:thin:@oracle.myserver.com:1521:mydb,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=10,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=house_dict,\
    props=user=system;password=******;server=mydb
    But I can connect to the database in my servlet/jsp using oracle:thin
    connect method, Why???
    The library I used is oracle's classes111.zip
    Help me please!!!!

    Remove the ';server=mydb' from the props.
    It would help if you included the error message from the weblogic log file.
    Mike
    "Killwin" <[email protected]> wrote:
    Help!
    I can not create oracle connection pool using the following
    directive in my weblogic.properties of wls5.1:
    weblogic.jdbc.connectionPool.oraclePool=\
    url=jdbc:oracle:thin:@oracle.myserver.com:1521:mydb,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=10,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=house_dict,\
    props=user=system;password=******;server=mydb
    But I can connect to the database in my servlet/jsp using oracle:thin
    connect method, Why???
    The library I used is oracle's classes111.zip
    Help me please!!!!

  • Web Dynpro application connecting to oracle

    Hi all,
    i want to create a web Dynpro application which will fetch data from oracle database.
    Can anyboby guide me with some documents.
    Thanks in advance.

    Thanks for your quick reply!
      I am trying in another way.I've created a WD application and in custom controller I've put the code for connection, copying the retrived data into context and trying to display the data in one view.
    CODE:
    DriverManager.registerDriver(
                  new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection(               "jdbc:oracle:thin:@oracle server ip:port:sid",
         "user name",
         "password");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select * from table");
    if (rs != null)
      while ( rs.next() )                     
         //code for copying data into context
    stmt.close();
    conn.close();
    Error(No class defination found) is at first line i.e. new oracle.jdbc.driver.OracleDriver().
    I've put classes.zip in lib and build path as well.
    Regards,
    Sarika.

  • Oracle Long Data type Problem

    Hi,
    I am using ORACLE 7.3.4 database. I am having a problem in updating a column of long datatype in a table t1 with another column from table t2 of long datatype. I have tried setting LONG 1000000 also but this doesn't work. I appreciate any kind of suggestions.
    The error it gives is ORA-00997: illegal use of LONG datatype.
    Thanks
    Reddy

    I had the same problem too with a newest thin driver. I found that I can read all my characters (bytes) using getBinaryStream() and single-byte read(), but read() never returns -1; instead reading the character before last causes the ArrayOutOfBoundsException you mentioned.
    So I just blindly caught the exception and let it go to QA. (sort of
    InputStream r = rs.getBinaryStream(field);
    if(r == null) ...
    StringBuffer sb = new StringBuffer();
    try { for(int c = -1;  (c = r.read()) != -1;)  sb.append((char) c); }
    catch(IndexOutOfBoundsException e)
    {} // ignore Oracle idiosyncrazy.
    finally { r.close(); }
    ). Please note that getCharacterStream() or getAsciiStream() did not work for me. I did not try deprecated getUnicodeStream(): I decided I would better correctly extract characters in Java from binary data myself if I need them rather than allowing this junky thin Oracle driver to do an extra thing for me.

  • GetConnection with no user or pass on oracle driver

    I am connecting to an Oracle DB using the thin oracle driver:
    Connection newConn = DriverManager.getConnection(dbUrl, user, password);
    this works fine, but now I want to connect to a db which has no user or password!
    I tried empty Strings like :
    Connection newConn = DriverManager.getConnection(dbUrl, "", "");
    or null like:
    Connection newConn = DriverManager.getConnection(dbUrl, null, null);
    but in all this cases I receive the ErrorMessage: "Invalid Arguments"!
    Do you know what's the problem with this driver or a workaround?
    Lot of Thanks,
    Maria

    thanks Cardwell,
    but I knew that and I tried all the 3 ways to connect ( with user & passwors, with url only and with the info struct ) but you allways need a user and password.
    i.e.if I want to connect with the url only I would need to write in the url the user/passw:
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:userxxx/passxxx@host:port/service");
    I just want to let user passw empty because I don't have some...
    Is there nobody with the same problem ???
    Thanks for help!
    Maria

  • Anyone know when will Oracle VDI support Oracle VM Server x86?

    Hi there.
    Is there a roadmap or plan for Oracle VDI support Oracle VM server x86?
    I think we need enterprise class(type-1) hypervisor.
    DH,

    I dont think its in the roadmap because Oracle VM does not lend itself nicely to all the technology deeply embedded in Oracle VDI, namely, VRDP which is a proprietary remote desktop protocol Oracle VDI leverages to paint screens directly from a VirtualBox remote display session. The only thin Oracle VM (Xen) has close to this is the dated VNC protocol.
    We went down this road early on, expecting Oracle VDI to integrate, but the more we learn about how Oracle VDI does things, the more it doesn't make sense to adapt Oracle VM Server to do this.
    I don't know Oracles plans surrounding this (who does?) but it would seem it would take ALOT of work and redesign to make that happen, whereas they already acquired Oracle VDI (and VirtualBox) from their SUN acquisition.

Maybe you are looking for

  • Help! My Vision M is no longer detected by my

    After my Zen froze up on me today I was forced to reset. After that my PC no longer detects that is is hooked up. The Zen says that it is docked,but nothing. I have removed and reinstalled my software. I've made sure that it is fully charged, no diff

  • How can I install adobe flash player on my iPod mini.

    How can i install adobe flash player on my Ipad mini?

  • Mountain Lion mails with attachments on exchange get lost

    Dear Community, we encounter a real annoying and weird issue with CS6 on our Macintoshs using Mountain Lion 10.8.2. It all started, that mails with attachments (e.g. JPGS, PDFS...) just get lost and do not arrive. Not all mails but some, spontaneousl

  • How do I find Desk top software from July 2012?

    Hi, I have the tour 9630 that crashed and I lost all contacts. I had a back up from July 2012. I updated my desktop software and tried to restore my back-up. The updated desk top software did not recognize my old backup file. I need the software that

  • CFCONTENT Excel - Firefox errors

    When I use <cfcontent type="application/vnd.ms-excel"> tag it works great on Internet Explorer. But when I use Firefox it doesnt It does NOT name the file correctly (It doesnt have the xls extension) therefore it doesnt make the file association with