Error during multiple connection to database.

Hi all,
We use software which connects to database and runs business process. Today I’ve noticed that user cant connect to database via this software from several hosts. I got error code ORA-20000. I think user has some limitation(in profile) to run software from several hosts(IP addresses) at the one time. Can i change this parameter?
Regards,
rustam

rustam_tj wrote:
Hi all,
We use software which connects to database and runs business process. Today I’ve noticed that user cant connect to database via this software from several hosts. I got error code ORA-20000. I think user has some limitation(in profile) to run software from several hosts(IP addresses) at the one time. Can i change this parameter?
Regards,
rustamngtndp02:stevense> oerr ora 20000
20000, 00000, "%s"
// *Cause:  The stored procedure 'raise_application_error'
// was called which causes this error to be generated.
// *Action: Correct the problem as described in the error message or contact
// the application administrator or DBA for more information.
So the error is raised by the application, not the rdbms. Was there any text associated with the message giving any indication what it was for? Do you have access to the PL/SQL that raised the error to see what kind of event could trigger it?
You think the user has a limitation in their profile, and you want to know if you can change it. Have you looked at a profile to see if there are any properties that support your thesis?

Similar Messages

  • RemoteException: java.rmi.ConnectIOException: error during JRMP connection

    We have a Java application implementing a RMI server.
    The server uses with the jacob api in order to generate Word files in a windows system.
    My clients work in linux.
    The RMI method is synchronized in order not to have problems executing Word from multiple threads.
    The application and the RMI server work all right for some time, but after some hours (sometimes days) the client throws the following error:
    RemoteException: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
    java.net.SocketException: Connection reset

    Hi Varun,
    This is definitely required even if you are on WAS6.40.
    After copying this , you have to also follow the register dll using this command
    rgsvr32 "c:\Winnt\system32\librfc32.dll"
    check the OS your using wether it is windowsXP/2003 or 2000.
    there are seperate commands for them to register the dll.
    This is available in the installation guide.
    we also had the same problem and then we did this and it worked for us.
    f you have done this, then there are other possibilities also
    1. Install SOAP toolkit on the CRM server as this is required to establish the connectivity
    2. See whether the MAPBOX services are deployed on the SAP J2EE engine
    3. Create RFC through SM59 only for mapbox and register them.
    4. See if there are any old versions of Java on your machine then uninstall them and install the required java components.
    Let us know if it resolved the problem
    Thanks
    Yash
    reward points if it helps.

  • Error during RFC connection

    Hi
    I am trying to edit test partner script from eca script, but i am getting one error 'ecatt error ECATT_STORE_BLOB(2)
    saving of blob denied for security reasons. you may not be in the edit mode of ecatt ' when i click on ok button it is telling error during RFC connection and whatever changes i made in test partner is not saved.
    How to solve this problem. Please help me.

    Is it working fine in the standalone mode?
    Refer to the below checklist for trouble shooting:
    1) Maintenance of DSN settings to the databases -  TP_EDIT and TP_EXEC
    2) Maintenance of R/3 connection parameters
    3) Refer eCATT Security guide
    4) Refer OSS note - 519858
    Please note that for an integration Scenario, the connection and user information is required so that appropriate rights are established automatically.
    Hope this helps!

  • Error during JRMP connection

    I am havin some problem with RMI. Let me explain the application a bit first.
    I've an application form which invokes some remote method from the database (oracle). Since oracle cannot call remote methods directly from database, we use a bridge which is developed in java.
    In order to run that i do the following in a batch file:
    start rmiregistry 2607
    rem Attempt to run the bridge
    echo Runing the bridge ...
    java com.cramer.syncengine.RegisterBridge
    the service starts up successfully without any prob.
    Now, when im using the application (which requires this RMI bridge and RMI registry) i'm getting the following error.
    Starting the RMI Registry...
    Runing the bridge ...
    Object instantiated: com.cramer.syncengine.SyncEngineBridgeServer[RemoteStub [ref: [endpoint:[172.24.5.99:1519](local),objID:[0]]]]
    java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
    java.net.SocketTimeoutException: Read timed out
    If anyone can help me out to understand where the problem is?

    It looks like your server is timing out trying to bind itself to the Registry. You might need to allow a little time for the Registry to get itself started before starting your server, or at least between the export and the bind inside your server code, or just retry the bind a couple of times after increasing intervals before bailing out.

  • Error: unable to connect to database using user system. please check privil

    Hi All,
    i have 2 oracle databases in my system (ORCL,RR). i am able to connect both databases i sql prompt. but in ggsci prompt not able to connect rr database due to below error
    dblogin userid system, password tiger.
    Error: unable to connect to database using user system. please check privil
    Can you please help me to connect RR database also in GGSCI promt.
    Thanks
    Raja

    Did you try with RR database tns name or sid while connecting ?
    If No then try this ,
    GGSCI (ATP) 6> DBLOGIN USERID SYSTEM@<tns alias name>
    Password:
    Successfully logged into database.
    HTP
    Annamalai.

  • Error: Unable to connect to database using connection_pool

    Hi experts
    I have created repository and reports on my windows machine using ODBC , Now i have tranfered this to on unix with OCI, But when i am connecting to my dtabase it is showng the error:
    Error: Unable to connect to database using connection_pool
    Please suggest how to resolve this..

    Have you install the Oracle client in your Unix server?

  • Getting error  "Can't connect to database DBMS is not supported in your current installation" in Demantra

    Hi,
    I have installed Microsoft Win x64(64-bit) Demantra 7.3.1.5 on Win 7(64-bit).
    When I try to open Business Modeler or Demand Planner or Business Logic Engine from :
    Start -> Oracle Demantra Spectrum , I am getting same error "Can't connect to database DBMS is not supported in your current installation"
    Below is a screenshot of same.
    I can connect to Collaborator Workbench though, but when I click on any of the "Planning Applications" from the menu in Collaborator Workbench window, again error is thrown.
    Error is  " Application could not be run! Error : undefined " as below :
    I have installed Oracle DB Enterprise edition 11gR2(64-bit)
    Please suggest where I am doing wrong.
    Regards,
    Vinni Sharma.

    Hi Sharma,
    Is this issue resolved? or still facing the same problem?
    We need to setup connections details in ds.ini file under demantra_installation\Demand Planner\Security Management folder on the server side.
    Regards,
    Akshay

  • Tns error could not connect to database but can tnsping and sqlplus

    The new install OBIEE 10.1.3.4.1, with two Linux RH/64 Bit servers set up and running, but can't get to 11g database when running reports.
    Error: nqsError 17001 Oracle Error Code 12154, message ORA-12154: TNS could not resolve the connect identifier specified at OCI call OCIServerAttach. nQSError 17014 could not connect to Oracle database
    Server 1 BI Server
    BI server is running.
    oc4j is running.
    jdk is installed
    /setup/user.sh variables and libs set
    .bash_profile variables and libs set
    oracle client installed with lib32
    can tnsping the database from here using SID
    can sqplus login to the database from here
    changed connection pool offiline and uploaded new .rpd
    this script does not work /setup . sa-cli.sh to test client, nothing happens, also unable to connect to BI Server in online mode from Windows client 32bit.
    Server 2 Presentation Server
    saw server is running
    set odbc AnalyticsWeb DSN to point to BI Server 1
    Since I can ping and connect with tns, why is presentation server throwing errors?
    Thanks for the help

    Copy the tnsname.ora file from Oracle Database serve onto the client PC.
    Path: %Oracle_home%\net80\admin\
    Send me a mail if there is any other issues
    Regards
    Oluseyi Funmi Oduberu
    Oracle Consultant
    Email:[email protected]
    Hi,
    I am a tech at a failing company. Unfortuneatly some users still need ADI installed and working with very limited resources to troubleshoot oracle. I am getting the error - ( Could not connect to the database - ora-12545: tns:name lookup failure )when the user tries to log on to ADI. Any suggestions? I would really appreciate it. We are on Windows NT on an NT network. Oracle 8.05 client installed and ADI 6.0.
    Thanks, Mary

  • Installing SBO 2007 Error Unable to connect to database

    Trying to install SBO 2007. 
    First install server tools, then sever. 
    The SBO -Common database exists as per checking the SQl database.
    The install asked for the database server, database name, user name and password in which I enter this correctly.
    A message states:
    WARNING
    'Unable to connect to database;verify database server name and that database is started'.
    I am unable to proceed further.  Can any on assit please.
    Have also tried un installing SBO 2007, deleting databases and rebooting - without success.

    Dear Lisa,
    You will get this issue when you are using named/non-default instance of MS SQL Server during the installation progress
    of SAP Business One Integration Platform.
    The B1iP installation program uses default port (1433) to connect MS SQL
    Server and to create database. The named instance will use the port
    other than 1433.
    1.  Before the installation of B1iP, change the port of the named
        instance to 1433, which will be used to install B1iP.
    2.  If 1433 is being used by another application, and cannot be changed,
        the steps below is one walk-around way:
        a) Stop the instance of MS SQL Server, which is using the port 1433
        b) Change the named instance, which will be used to install B1iP, to
           1433 temporary, and remember the port to recover
        c) Install B1iP (or SAP Business One with B1iP component)
        d) After installation, stop the B1i service. Under B1i folder, in
           the Xcellerator.cfg, change 1433 to the port that B1iP DB
           instance used.
        e) Change back the ports of SQL Server.
        f) Run the service of SQL Server and B1i again.
    Regards,
    Rakesh Pati
    SAP Business One Forum Team

  • Error during JCO connection

    Hi,
    I am currently running on EP6.0 sp2(J2ee engine 6.2).
      During Jco connection executing BAPI in the Bakened system i am getting the followinmg error.
    <b>com.sapportals.portal.prt.component.PortalComponentException 31 : >>
    > com.sapportals.portal.prt.component.PortalComponentException
    com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Portal Component
    Component : Connect.Bapi_getlist
    Component class : pkg.Bapi_getlist
    User : 511972
    at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:858)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:310)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)
    at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:209)
    at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:576)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:669)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)
    at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:832)
    at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:666)
    at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:313)
    at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)
    at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)
    at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)
    at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)
    at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)
    > Caused by: java.lang.NoClassDefFoundError
    at pkg.Bapi_getlist.doContent(Bapi_getlist.java:38)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)
    at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:209)
    at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:576)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:300)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:190)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:669)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)
    at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:832)
    at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:666)
    at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:313)
    at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)
    at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)
    at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)
    at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)
    at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)
    <</b>
    the same code when i am executing in the WAS 6.4 system
    its executing properly.
    why its throughing error in EP6.0 sp2(J2ee engine 6.2) Portal server.
    Regards

    Hello,
    Please see if note: 765461 is relevant for you.
    Best Regards,
    Ran

  • FCS DB backup failed w/error: "couldn't connect to database "template1"

    Hi,
    I am testing two different FCS systems (on two different machines, the same config).
    I wanted to backup FCS on one machine manually and it was not possible. I tried to do the same on the second machine and it was also not possible. I checked logs for automatic backup on both machines and everything worked until 22nd of April.
    I am not sure if I did download some update, but I am sure I didn't change anything on both machines nor FCS settings.
    I got this error message when I tried to backup:
    *Backup failed: pg_dumpall exited with code 1.*
    *Checking for other backup processes...*
    *Starting database backup to path '/Volumes/ProxyA/FCSBackups/Final Cut Server DB Backup on fcserver-1 at 2009-04-23 0000.zip'...*
    *pg_dumpall: could not connect to database "template1": could not connect to server: Connection refused*
    *Is the server running locally and accepting*
    *connections on Unix domain socket "/tmp/.s.PGSQL.5433"?*
    Both systems work normally. I "just" can't backup the DB.
    What happened ?
    Thank you.

    Hi Sam,
    Sometimes it is only because you have not set the environment correctly (ORACLE_HOME, ORACLE_SID).
    Is your TNSNAMES.ORA correct?
    If you do a "ps -ef |grep oracle" you should get a list of processes. Make sure you see PMON and SMON processes as well as the LSNR processes.
    If you don't see the LSNR processes start the listener.
    If this don't help try to start the DB manually and check with tsnping, otherwise come back again with mor info.
    regards
    Wolfgang

  • Multiple connection in Database ver 9i

    I am trying to connect multiple session to database 9i through form builder.
    if more than one session exist then procedure recompilation is hanging in other session.At a time only one session is working through form builder.

    Thanks for reply.
    It is only happening with oracle database 9i .recently I have switched over one of my developement environment to database 9i from 8i.
    With same configuration there was no problem in 8i .
    I have checked v$session_wait and v$lock there is no problem.
    again I have checked tablespace for space it is OK.
    undo_management is in Auto.
    Please let me know any clue.
    Arun

  • RFC Connection Error during Web AS ABAP Database Instance

    I keep getting RFC Connection error installing the database instance.  The following are the pertinent logs:
    INFO 2007-05-09 20:10:04
    Working directory changed to C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\MSS\UC\DB.
    INFO 2007-05-09 20:10:04
    Output of C:\usr\sap\X22\SYS\exe\run\r3trans.exe -u 1 -i "C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\MSS\UC\DB\mssprocs640.dat" is written to the logfile r3trans.exe.log.
    INFO 2007-05-09 20:10:22
    Execution of the command "C:\usr\sap\X22\SYS\exe\run\r3trans.exe -u 1 -i "C:\Program Files\sapinst_instdir\NW04\SYSTEM\ABAP\MSS\UC\DB\mssprocs640.dat"" finished with return code 0. Output: This is C:\usr\sap\X22\SYS\exe\run\r3trans.exe version 6.13 (release 640 - 03.06.05 - 17:04:00).unicode enabled versionC:\usr\sap\X22\SYS\exe\run\r3trans.exe finished (0000).
    INFO 2007-05-09 20:12:23
    RFC parameter CLIENT set to value 000.
    INFO 2007-05-09 20:12:23
    RFC parameter USER set to value DDIC.
    INFO 2007-05-09 20:12:23
    RFC parameter LCHECK set to value 1.
    INFO 2007-05-09 20:12:23
    RFC parameter PCS set to value 1.
    INFO 2007-05-09 20:12:23
    RFC parameter LANG set to value EN.
    INFO 2007-05-09 20:12:23
    RFC parameter ASHOST set to value cix22.
    INFO 2007-05-09 20:12:23
    RFC parameter SYSNR set to value 00.
    INFO 2007-05-09 20:12:23
    RFC connection information checked successfully.
    ERROR 2007-05-09 20:12:24
    FRF-00007  Unable to open RFC connection.
    I tried the following fixes spread across different threads in this Expert Forums:
    1. Someone said network problem.  I rebooted, restarted the install and even redo it. 
    2.  Another suggestion was to use caps on the password.  Didnt work.
    3.  One suggestion was to update the keydb.xml file.  However, I could find such property name:
    search for the table t_SAPComponent_SAPSystemLogon_SHARED
    then look for <fld name="pPW">, <properties>,
    <property name ="GUIENG_USER_INPUT" and set the value
    "GUINEG_TRUE" to "GUIENG_FALSE".
    4. I even used the ddic password 19920706 which is supposed to be the default.
    5. Restarted the instance and applied all the fixes above.
    Does anyone know what is going on base on the logs above?  Thanks.

    try moving all your install disk onto local file system then rerun the install. That might work....

  • Error message when connecting to database!

    Hi
    For this assignment i create a databse with Acces. when i run the following code i get an error message.
    Dropping indexes & tables ?
    Could not drop primary key on UserStocks table: [Microsoft][ODBC Microsoft Access Driver] Cannot find table or constrant.
    Could not drop UserStocs table: [Microsoft][ODBC Microsoft Access Driver] Table ?UserStocks? does not exist.
    Creating tables ?????????..
    Creating Stocks table with primary key index ?
    Creating Users table with primary key index ?
    Creating UserStocks table ?
    Exception creating UserStocks table: [Microsoft][ODBC Microsoft Access Driver] Syntax error in CREATE TABLE statement.
    Creating UserStocks table primary key index ?
    Exception creating UserStocks index: [Microsoft][ODBC Microsoft Access Driver] Cannot find table or constraint.
    Database created.
    An extract of an error further down after running MakeDB.java
    Chapter 11: The MakeDB Class
    Programmer: Michael Mick
    Date: December 16, 2004
    Filename: MakeDB.java
    Purpose: To build an initial database for the StockTracker application
    import java.sql.*;
    import java.io.*;
    public class MakeDB
    public static void main(String[] args) throws Exception
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbc:odbc:StockTracker";
    Connection con = DriverManager.getConnection(url);
    Statement stmt = con.createStatement();
    // The following code deletes each index and table, if they exist.
    // If they do not exist, a message is displayed and execution continues.
    System.out.println("Dropping indexes & tables ...");
    try
    stmt.executeUpdate("DROP INDEX PK_UserStocks ON UserStocks");
    catch (Exception e)
    System.out.println("Could not drop primary key on UserStocks table: "
    + e.getMessage());
    try
    stmt.executeUpdate("DROP TABLE UserStocks");
    catch (Exception e)
    System.out.println("Could not drop UserStocks table: "
    + e.getMessage());
    try
    stmt.executeUpdate("DROP TABLE Users");
    catch (Exception e)
    System.out.println("Could not drop Users table: "
    + e.getMessage());
    try
    stmt.executeUpdate("DROP TABLE Stocks");
    catch (Exception e)
    System.out.println("Could not drop Stocks table: "
    + e.getMessage());
    /////////////////////////Create the database tables/////////////////////////
    System.out.println("\nCreating tables ......................");
    // Create Stocks table with primary key index
    try
    System.out.println("Creating Stocks table with primary key index ... ");
    stmt.executeUpdate("CREATE TABLE Stocks ("
    + "symbol TEXT(8) NOT NULL "
    + "CONSTRAINT PK_Stocks PRIMARY KEY, "
    + "name TEXT(50)"
    + ")");
    catch (Exception e)
    System.out.println("Exception creating Stocks table: "
    + e.getMessage());
    // Create Users table with primary key index
    try
    System.out.println("Creating Users table with primary key index ... ");
    stmt.executeUpdate("CREATE TABLE Users ("
    + "userID TEXT(20) NOT NULL "
    + "CONSTRAINT PK_Users PRIMARY KEY, "
    + "lastName TEXT(30) NOT NULL, "
    + "firstName TEXT(30) NOT NULL, "
    + "pswd LONGBINARY, "
    + "admin BIT"
    + ")");
    catch (Exception e)
    System.out.println("Exception creating Users table: "
    + e.getMessage());
    // Create UserStocks table with foreign keys to Users and Stocks tables
    try
    System.out.println("Creating UserStocks table ... ");
    stmt.executeUpdate("CREATE TABLE UserStocks ("
    + "userID TEXT(20) "
    + "CONTRAINT FK1_UserStocks REFERENCES Users (userID), "
    + "symbol TEXT(8), "
    + "CONSTRAINT FK2_UserStocks FOREIGN KEY (symbol) "
    + "REFERENCES Stocks (symbol))");
    catch (Exception e)
    System.out.println("Exception creating UserStocks table: "
    + e.getMessage());
    // Create UserStocks table primary key index
    try
    System.out.println("Creating UserStocks table primary key index ... ");
    stmt.executeUpdate("CREATE UNIQUE INDEX PK_UserStocks "
    + "ON UserStocks (userID, symbol) "
    + "WITH PRIMARY DISALLOW NULL");
    catch (Exception e)
    System.out.println("Exception creating UserStocks index: "
    + e.getMessage());
    // Create one administrative user with password as initial data
    String userID = "admin01";
    String firstName = "Default";
    String lastName = "Admin";
    String initialPswd = "admin01";
    Password pswd = new Password(initialPswd);
    boolean admin = true;
    PreparedStatement pStmt =
    con.prepareStatement("INSERT INTO Users VALUES (?,?,?,?,?)");
    try
    pStmt.setString(1, userID);
    pStmt.setString(2, lastName);
    pStmt.setString(3, firstName);
    pStmt.setBytes(4, serializeObj(pswd));
    pStmt.setBoolean(5,admin);
    pStmt.executeUpdate();
    catch (Exception e)
    System.out.println("Exception inserting user: "
    + e.getMessage());
    pStmt.close();
    // Read and display all User data in the database.
    ResultSet rs = stmt.executeQuery("SELECT * FROM Users");
    System.out.println("Database created.\n");
    System.out.println("Displaying data from databae ... \n");
    System.out.println("Users table contains:");
    Password pswdFromDB;
    byte[] buf = null;
    while(rs.next())
    System.out.println("Logon ID = "
    + rs.getString("userID"));
    System.out.println("First name = "
    + rs.getString("firstName"));
    System.out.println("Last name = "+ rs.getString("lastName"));
    System.out.println("Administratvie = "+ rs.getBoolean("admin"));
    System.out.println("Initial password = "+ initialPswd);
    // Do NOT use with JDK 1.2.2 using JCBC - ODBC bridge as
    // SQL NULL data value is not handled correctly
    buf = rs.getBytes("pswd");
    if (buf != null)
    System.out.println("Password Object = "
    + (pswdFromDB=(Password)deserializeObj(buf)));
    System.out.println(" AutoExpires = "+ pswdFromDB.getAutoExpires());
    System.out.println(" Expiring now = "+ pswdFromDB.isExpiring());
    System.out.println(" Remaining uses = "
    + pswdFromDB.getRemainingUses() + "\n");
    else
    System.out.println("Password Object = NULL!");
    rs = stmt.executeQuery("SELECT * FROM Stocks");
    if(!rs.next())
    System.out.println("Stocks table contains no records.");
    else
    System.out.println("Stocks table still contains records!");
    rs = stmt.executeQuery("SELECT * FROM UserStocks");
    if(!rs.next())
    System.out.println("UserStocks table contains no records.");
    else
    System.out.println("UserStocks table still contains records!");
    stmt.close(); // closing Statment also closes ResultSet
    } // end of main()
    // Method to write object to byte array and then insert into prepared statement
    public static byte[] serializeObj(Object obj)
    throws IOException
    ByteArrayOutputStream baOStream = new ByteArrayOutputStream();
    ObjectOutputStream objOStream = new ObjectOutputStream(baOStream);
    objOStream.writeObject(obj); // object must be Serializable
    objOStream.flush();
    objOStream.close();
    return baOStream.toByteArray(); // returns stream as byte array
    // Method to read bytes from result set into a byte array and then
    // create an input stream and read the data into an object
    public static Object deserializeObj(byte[] buf)
    throws IOException, ClassNotFoundException
    Object obj = null;
    if (buf != null)
    ObjectInputStream objIStream =
    new ObjectInputStream(new ByteArrayInputStream(buf));
    obj = objIStream.readObject(); // throws IOException, ClassNotFoundException
    return obj;
    } // end of class

    This is the output i get when i change the getMessage with printStackTrace.
    String getMessage() replaced with printStackTrace:
    G:\studies\Chapter11\MakeDB.java:33: 'void' type not allowed here
                   System.out.println("Could not drop primary key on UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:43: 'void' type not allowed here
                   System.out.println("Could not drop UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:54: 'void' type not allowed here
                   System.out.println("Could not drop Users table: "
    ^
    G:\studies\Chapter11\MakeDB.java:64: 'void' type not allowed here
                   System.out.println("Could not drop Stocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:83: 'void' type not allowed here
                   System.out.println("Exception creating Stocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:102: 'void' type not allowed here
                   System.out.println("Exception creating Users table: "
    ^
    G:\studies\Chapter11\MakeDB.java:119: 'void' type not allowed here
                   System.out.println("Exception creating UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:133: 'void' type not allowed here
                   System.out.println("Exception creating UserStocks index: "
    ^
    G:\studies\Chapter11\MakeDB.java:159: 'void' type not allowed here
                   System.out.println("Exception inserting user: "
    ^
    9 errors
    Tool completed with exit code 1

  • Error during the installation  of Database instance

    Hi All,
    I am installing database instance on a seperate database server for Netweaver 7.0 EHP 2 , the databse servers has several drives . For NW 7.0 installation 2 drives are reserved
    Drive N : 200 GB
    Drive O : 200 GB
    During DB Instance installation after selecting the Datafiles ( Ex : 4 databfiles ) in the next screen SAPinst throws error
    " The Drive N : does not exist or is unaccessible for MS Sql Server "  however I can continue installation if I select any other drive except N & O . Kindly suggest what might be the reason for the error.

    Hello Suny,
    For the MS SQL Installation in windows envirnment ....could you pls chcek for the below two things:
    1.If Your CD drive is MOUNTed........(Shared locally)
    2.Your drives are Mounted (Shared locally)
    Rewards poins are useful on help!

Maybe you are looking for

  • HP Deskjet F4440 not printing from cups, do I need ppd? Where can I find it?

    Hello!, I am trying to get my HP Deskjet F4440 connected to my linux server through the use of "cups". I am using Tiny Core Linux. Linux box 3.16.6-tinycore #777 SMP i686 GNU/Linux I have installed and configured cups.tcz. When I visit the cups admin

  • Drag and drop does not work with multiple images

    if i try to drag and drop more than one image, nothing happens, no activity at all. i think i had this problem on another computer and it had something to do with the fonts. i can not remember exactly thanks iphoto 6

  • Need a script for squaring images of various sizes please

    Hello, new to this group but have been using photoshop for years doing basic editing. I have never done any sripting. I have a project on my hands. I have a lot of image of various sizes with some taller or wider than others. I need to make all these

  • Why will the apps on my iPad no longer work?

    On most of my apps, when I try to use them, the iPad closes the app and goes back to the "desktop" screen.  This even happens when I try to go into my settings to look at my setups.

  • Error in Accessing another Schema

    When i access table in another schema then the table is accessed but when i execute query it returns the following error Using PL/SQL Developer Access Violation at address 606B90F0 in module 'ORACLIENT9.Dll'.Read the 00000000 What this error is and w