Can not use prepared statement

i am using a prepared statement for the following query but the query does not give me an output where as if i use a create statement i am getting my result
can any one say why is it ? or what the problem is
            String strQuery = " select lic.lic_id  licId, "+                                                   " lic.license_nbr licNo, "+                                                   " lt.display_desc licType "+                                                   " from colamgr.cola_entities ent, "+                                                 " colamgr.cola_licenses lic, "+                                                 " colamgr.cola_lic_types lt, "+                                                 " colamgr.cola_boards    boa "+                                           " where (( 'E'= ? and ent.ent_id = ?) "+                                           " or ( 'L'= ? and lic.lic_id = ?)) "+                                           " and lic.ent_id = ent.ent_id "+                                           " and lic.license_status ='ACTIVE' "+                                           " and lic.lt_id = lt.lt_id "+                                           " and boa.boa_id = lt.boa_id "+                                           " and (( 'E' = ? and (lt.print_ent_addr_ind <> 'N' "+                                           " or (lt.print_lic_addr_ind <> 'N' and lic.addr1 is null))) "+                                           " or  ( 'L' = ? and lt.print_lic_addr_ind <> 'N')) "+                                           " UNION "+                                           " select  empl_lic.lic_id  licId, "+                                                   " empl_lic.license_nbr licNo, "+                                                   " empl_lt.display_desc licType "+                                                                                     " from colamgr.cola_entities  ent, "+                                                 " colamgr.cola_licenses  lic, "+                                                 " colamgr.cola_lic_types lt, "+                                                 " colamgr.cola_lic_xrefs lx, "+                                                 " colamgr.cola_licenses  empl_lic, "+                                                 " colamgr.cola_lic_types empl_lt, "+                                                 " colamgr.cola_boards    empl_boa "+                                           " where (( 'E'= ? and ent.ent_id = ?) "+                                           " or ( and lic.lic_id = ? and 'L'= ? )) "+                                           " and lic.ent_id              = ent.ent_id "+                                           " and lic.lic_id              = lx.lic_id "+                                           " and lic.license_status      ='ACTIVE' "+                                           " and lx.approval_ind        = 'A' "+                                           " and lx.begin_date          is not null "+                                           " and lx.end_date            is null "+                                           " and lx.lic_id_child        = empl_lic.lic_id "+                                           " and empl_lt.lt_id          = empl_lic.lt_id "+                                           " and empl_boa.boa_id        = empl_lt.boa_id "+                                           " and empl_lic.license_status = 'ACTIVE' "+                                           " and lic.lt_id              = lt.lt_id "+                                           " and exists (select 1 "+                                                       " from colamgr.cola_lic_types lt1 "+                                                       " where lt1.lt_id = empl_lic.lt_id "+                                                       " and ((lt1.xref1_ind in ('M') "+                                                       " and  lt1.xref1_lt_id = lt.lt_id "+                                                       " and  (('E'= ? and (lt1.print_xref1_ent_addr_ind <> 'N' "+                                                       " or (lt1.print_xref1_lic_addr_ind <> 'N' and lic.addr1 is null))) "+                                                       " or    ( 'L' = ? and lt1.print_xref1_lic_addr_ind <> 'N'))) "+                                                       " or  (lt1.xref2_ind in ('M') "+                                                       " and  lt1.xref2_lt_id = lt.lt_id "+                                                       " and  (('E'= ? and (lt1.print_xref2_ent_addr_ind <> 'N' "+                                                       " or (lt1.print_xref2_lic_addr_ind <> 'N' and lic.addr1 is null))) "+                                                       " or    ( 'L' = ? and lt1.print_xref2_lic_addr_ind <> 'N'))) "+                                                       " or  (lt1.xref1_ind in ('O') "+                                                       " and  (lt1.xref1_lt_id = lt.lt_id or lt1.xref2_lt_id = lt.lt_id) "+                                                       " and  (('E'= ? and (lt1.print_xref1_ent_addr_ind <> 'N' "+                                                       " or (lt1.print_xref1_lic_addr_ind <> 'N' and lic.addr1 is null))) "+                                                       " or    ('L' = ? and lt1.print_xref1_lic_addr_ind <> 'N'))))) "+                                                       " order by 6 desc, 7 asc ";

here is my code which works . when i replace the ? ( where i am checking strAddrtype ='L' using set string it doesn't work . i wanted to know why its not working any help is much appreciated.
thanks .
        public ArrayList getReprintLicenses(String strEntId, String strLicId, String strAddrType)
          ArrayList alMasterLicList = new ArrayList();
           String strQuery = " select lic.lic_id   licId, "+
                                                 " lic.license_nbr licNo, "+
                                                 " lt.display_desc licType, "+
                                                 " colamgr.COLA_CHK_RENEW_STAT(lic.lic_id) renewStatus, "+
                                                 " 0, "+
                                                 " SUBSTR(lic.License_nbr,1,4), "+
                                                 " SUBSTR(lic.License_nbr,5) "+
                                          " from cola_entities ent, "+
                                               " cola_licenses lic, "+
                                               " cola_lic_types lt, "+
                                               " cola_boards    boa "+
                                          " where ((?= 'E' and ent.ent_id = ? ) "+
                                          " or ("+strAddrType+" = 'L' and lic.lic_id = ?)) "+
                                          " and lic.ent_id = ent.ent_id "+
                                          " and lic.license_status ='ACTIVE' "+
                                          " and lic.lt_id = lt.lt_id "+
                                          " and boa.boa_id = lt.boa_id "+
                                          " and ((?= 'E' and (lt.print_ent_addr_ind <> 'N' "+
                                          " or (lt.print_lic_addr_ind <> 'N' and lic.addr1 is null))) "+
                                          " or   ("+strAddrType+" = 'L' and lt.print_lic_addr_ind <> 'N')) "+
                                          " UNION "+
                                          " select  empl_lic.lic_id  licId, "+
                                                  " empl_lic.license_nbr licNo, "+
                                                  " empl_lt.display_desc licType, "+
                                                  " COLA_CHK_RENEW_STAT(empl_lic.lic_id) renewStatus, "+
                                                  " 1, "+
                                                  " SUBSTR(lic.License_nbr,1,4), "+
                                                  " SUBSTR(lic.License_nbr,5) "+
                                          " from cola_entities  ent, "+
                                               " cola_licenses  lic, "+
                                               " cola_lic_types lt, "+
                                               " cola_lic_xrefs lx, "+
                                               " cola_licenses  empl_lic, "+
                                               " cola_lic_types empl_lt, "+
                                               " cola_boards    empl_boa "+
                                          " where ((? = 'E' and ent.ent_id =?) "+
                                          " or ("+strAddrType+" = 'L' and lic.lic_id =?)) "+
                                          " and lic.ent_id              = ent.ent_id "+
                                          " and lic.lic_id              = lx.lic_id "+
                                          " and lic.license_status      ='ACTIVE' "+
                                          " and lx.approval_ind         = 'A' "+
                                          " and lx.begin_date           is not null "+
                                          " and lx.end_date             is null "+
                                          " and lx.lic_id_child         = empl_lic.lic_id "+
                                          " and empl_lt.lt_id           = empl_lic.lt_id "+
                                          " and empl_boa.boa_id         = empl_lt.boa_id "+
                                          " and empl_lic.license_status = 'ACTIVE' "+
                                          " and lic.lt_id               = lt.lt_id "+
                                          " and exists (select 1 "+
                                                      " from cola_lic_types lt1 "+
                                                      " where lt1.lt_id = empl_lic.lt_id "+
                                                      " and ((lt1.xref1_ind in ('M') "+
                                                      " and  lt1.xref1_lt_id = lt.lt_id "+
                                                      " and  ((? = 'E' and (lt1.print_xref1_ent_addr_ind <> 'N' "+
                                                      " or (lt1.print_xref1_lic_addr_ind <> 'N' and lic.addr1 is null))) "+
                                                      " or    (?= 'L' and lt1.print_xref1_lic_addr_ind <> 'N'))) "+
                                                      " or   (lt1.xref2_ind in ('M') "+
                                                      " and  lt1.xref2_lt_id = lt.lt_id "+
                                                      " and  ((?= 'E' and (lt1.print_xref2_ent_addr_ind <> 'N' "+
                                                      " or (lt1.print_xref2_lic_addr_ind <> 'N' and lic.addr1 is null))) "+
                                                      " or    (? = 'L' and lt1.print_xref2_lic_addr_ind <> 'N'))) "+
                                                      " or   (lt1.xref1_ind in ('O') "+
                                                      " and   (lt1.xref1_lt_id = lt.lt_id or lt1.xref2_lt_id = lt.lt_id) "+
                                                      " and  ((? = 'E' and (lt1.print_xref1_ent_addr_ind <> 'N' "+
                                                      " or (lt1.print_xref1_lic_addr_ind <> 'N' and lic.addr1 is null))) "+
                                                      " or    (? = 'L' and lt1.print_xref1_lic_addr_ind <> 'N'))))) "+
                                                      " order by 6 desc, 7 asc ";
          try
            con = getDSconn();
     //  stmt = con.createStatement();
          pstmt=con.prepareStatement(strQuery);
           // rs = stmt.executeQuery(strQuery);
        pstmt.setString(1,strAddrtype);
         pstmt.setString(2,strEntId);
         pstmt.setString(3,strLicId);
         pstmt.setString(4,strAddrtype);
         pstmt.setString(5,strAddrtype);
         pstmt.setString(6,strEntId);
         pstmt.setString(7,strLicId);
         pstmt.setString(8,strAddrtype);
         pstmt.setString(9,strAddrtype);
         pstmt.setString(10,strAddrtype);
         pstmt.setString(11,strAddrtype);
pstmt.setString(12,strAddrtype);
pstmt.setString(13,strAddrtype);
          rs=pstmt.executeQuery();
            while (rs.next())
              LicenseeForm licenseInfo = new LicenseeForm();
              licenseInfo.setLicId(rs.getString(1));
              licenseInfo.setLicNo(rs.getString(2));
              licenseInfo.setLicType(rs.getString(3));
              //licenseInfo.setBoard(rs.getString(4));
              licenseInfo.setRenewStatus(rs.getString(4));
              alMasterLicList.add(licenseInfo);
            rs.close();
            pstmt.close();
            con.close();
            con = null;
          catch (RuntimeException re)
                throw re;
          catch(Exception e)
          { e.printStackTrace();
            try
              rs.close();
              pstmt.close();
              con.close();
              con = null;
            catch(Exception i){}
          finally
            try
              pstmt.close();
              con.close();
              con = null;
            catch(Exception i){}
          return alMasterLicList;     
       

Similar Messages

  • ? in SQL Queries and not using prepared statements

    Using EclipseLink 1.1.1
    Prepared Statements are disabled
    In our production server something went wrong and one of our Read Queries started erroring. A DatabaseException was thrown and we log the "getQuery.getSQLString()" statement. We found this query in the logs:
    SELECT t1.ID, t1.NAME, t1.DESCRIPTION, t1.EXTREFID, t1.STYLESHEET, t1.DDSVNVERSION, t1.FIRSTNAME, t1.LASTNAME, t1.EMAILADDR, t1.PHONENUMBER, t1.ADDRESS, t1.ADDRESS2, t1.CITY, t1.STATE, t1.POSTALCODE, t1.COUNTRY, t1.ADMINACCTNAME, t1.HASDOCUMENTS, t1.HASTIMEDNOTIFICATIONS, t1.STATUS, t1.ENTRYDATE, t1.EVALEXPDATE, t1.LASTREMINDDATE, t1.FULLUSERS, t1.LIMUSERS, t1.REQUSERS, t1.ISENTERPRISE, t1.EXPDATE, t1.ISDISABLED, t1.DISABLEDDATE, t1.NEEDLICENSEAGREEMENT, t1.ISWARNINGDISABLED, t1.LOCALE, t1.TIMEZONE, t1.CURRENCY, t1.DOMAIN, t1.DOCUMENTSIZE, t1.EXTRADOCUMENTSTORAGE, t1.ONDEMANDOPTIONS, t1.SSOTYPE, t1.RESELLERID, t1.ACCOUNTREPID, t1.LASTUSAGEREPORTDATE, t1.NEXTUSAGEREPORTDATE, t1.USAGEREPORTATTEMPTS FROM T_SSOOPTIONS t0, T_CUSTOMERS t1 WHERE *((((t0.SSOENABLED = ?) AND (t1.SSOTYPE IN (?, ?))) AND (UPPER(t1.DOMAIN) = ?)) AND (t0.CUSTOMERID = t1.ID))*
    Notice the values weren't entered into the where clause. We had to bounce the application to fix the problem. I've never seen this before. I've added more debugging statements to the code - so if this happens again in the future I'll have more information to report on. In the mean time I'm wondering if anyone else has every seen a problem of this nature.

    Database error due to invalid SQL statement.
    I don't have a stack, we were catching the exception and not printing the stack :(
    Like I mentioned in my first post, I added more debugging code (e.printStackTrace()). I understand this is hard to track down without more information. I was just hoping you guys had seen something like this before and had any insight. Like I mentioned before: this is on our production server. I've never seen this type of error before. That particular server (we run in a cluster mode) had been up for several days and then started generating that error. IT bounced the node and everything went back to normal. We have been using toplink for about 5 years now and have never seen this problem, until August 3rd 2009. The only thing that has changed recently is our migration from toplink 10 to EclipseLink. I was wondering if anyone knows if anything had changed in EclipseLink/toplink 11 with the generation of SQL queries.
    I'll keep looking. There is more debugging code in there now. Since the error was "Database error due to invalid SQL statement" this implies the SQL was generated, exited that part of the code and was sent to the db where it failed. I'm afraid the printStackTrace won't help if this error happens again.

  • Advantages of using prepared statement..... ?

    can anyone please tell me that what r the advantages of using prepared statements.
    for eg in case if statement object is executed inside a for loop where query is executed multiple times the sql query is compiled outside loop and therefore compilation is done only once. which makes sense
    But if there the query is not executed multiple times then what is the real benifit of using prepared statement . because the statement object will be closed after executing the query.
    and a new statement object will be created when other user access the same code.
    please clearify my doubts
    thanks
    Pankaj

    Other advantages of using PreparedStatement:
    1. It's easier to create SQL that looks like "Select This, That, TheOther from Something where ID=? and Usage=?" than to try to generate that with string concatenations.
    2. You don't have to deal with escaping quote characters that happen to appear in strings you want to insert in your database.
    3. PreparedStatements can do some things that Statement can't, such as updating very large text columns.

  • Could not find prepared statement with handle 13

    Hi,
    I'm having a terrible problem: When I try to execute a SQL Query the following exception is thrown:
    * "java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Could not find prepared statement with handle 13."
    This exception is thrown is this line:
    boolean returnResultSet = ((PreparedStatement)sqlStatement).execute();
    The sqlStatement object is a java.sql.PreparedStatement that was received as a Statement in the method definition.
    The following query is being executed in this PreparedStatement:
    SELECT id_promocao, ds_nome, id_tipo, ds_sinopse, dt_lancamento, pt_site, pt_caminho_relativo, fl_ativo FROM TAB_CINE_GM ORDER BY ds_nome
    I'm using Macromedia JRun 4 build 61650 and I'm using MS-SQL Server 2000 as a database server.
    If anyone can help, I'll thanks a lot.
    Helcio Chaves
    S�o Paulo - SP - Brazil
    [email protected]

    There is a common way to check runtime type:
    if (sqlStatement instanceof PreparedStatement)
    returnResultSet = ((PreparedStatement)sqlStatement).execute();
    else
    returnResultSet = sqlStatement.execute();
    }By the way - I can't understand why you're trying to cast sqlStatement to PreparedStatement? It doesn't matter at all due to so-called polymorphism of all Java methods (except static ones). Anyway execute() will run for PreparedStatement but bot for Statement
    Enjoy,
    Pavel

  • FindByPrimaryKey: Could not find prepared statement with handle 3

    I've inherited a WL61 application and been asked to make it work under WL81. We're using SQL Server 2000. We only access two tables. The XML got auto-converted during the upgrade, but I had to correct the RDBMS column names in the weblogic-cmp-jar.xml
    The application mostly works except the findByPrimaryKey fails with:
    ERROR ExecuteThread: '14' for queue: 'weblogic.kernel.Default' Administrator : TargetSessionBean - Error finding promotion with ID <2>
    javax.ejb.FinderException: Problem in findByPrimaryKey while preparing or executing statement: 'weblogic.jdbc.wrapper.PreparedStatement_weblogic_jdbc_base_BasePreparedStatement@95':
    java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Could not find prepared statement with handle 3.
    java.sql.SQLException: [BEA][SQLServer JDBC Driver][SQLServer]Could not find prepared statement with handle 3.
    at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
    at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
    I've checked the database table and the row exisits with the appropriate PK (in this case a promotion with ID <2>).
    In the WL61 version the findByPrimaryKey was explicitly defined in the weblogic-cmp-rdbms-jar.xml as follows:
    <finder>
    <method-name>findByPrimaryKey</method-name>
    <method-params>
    <method-param>com.fujitsu.ftxs.corema.server.PromotionPK</method-param>
    </method-params>
    <finder-query><![CDATA[ (= $0 promotionId) ]]></finder-query>
    <finder-expression>
    <expression-number>0</expression-number>
    <expression-text><![CDATA[@0.promotionId]]></expression-text>
    <expression-type>int</expression-type>
    </finder-expression>
    </finder
    But I understand that with WL81 I should no longer define this - it's done implicitly - so I've removed this finder definition.
    Any help appreciated. Thanks,
    - Andy Abel

    I fixed it by switching from the using the BEA driver:-
    DriverName="weblogic.jdbc.sqlserver.SQLServerDriver"
    URL="jdbc:bea:sqlserver://host:1433"
    And using the Microsoft Driver instead:-
    DriverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
    url=jdbc:microsoft:sqlserver://host:1433
    If anyone can explain why the Microsoft Driver works and the BEA driver does not I'd like to know.
    Thanks,
    - Andy Abel

  • Can we use Loop Statement for Ranges

    Hi Friends,
    I have a range say R_Range. I need to loop at each line item and get the values in another range R_New_Range, i have to count the number of items in R_new_range. How is it possible.
    I know range is nothing but an internal table. So we can direcly use Move statements or so ...,
    But my question is .....
    My R_range has values as below
    'I' 'EQ' '001'
    'I' 'EQ' '002'
    'I' 'BT' '003' '007'
    'I' 'EQ' '008'
    I have to move all these values to R_New_range and my count of items should be '8'.
    How can i do that????????
    Expecting ur answers....
    Thanks in advance
    Cheers,
    R.Kripa.

    hey friends,
    Its nice to see the replies.... but i think i had confused u all with the question
    Now i'll explain u all in detail ....
    See i have 15000 projects ( eg., AAA111... ) and 100 GL accounts ( eg., 123443... ) .....
    I have to get the costs from COSS and COSP tables for all the projects - GL account combinations which leads to some 1500000 entries ..... So it is giving me a SQL Dump "DBIF_RSQL_INVALID_RSQL" .........
    Description of the Dump is
    Error in the module RSQL accessing the database interface
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was
    neither                                                                
    caught nor passed along using a RAISING clause, in the procedure        
    "GET_COSP_COSS" "(FORM)"                                               
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.                          
    The reason for the exception is:                                        
    The SQL statement generated from the SAP Open SQL Statement violates a  
    restriction imposed by the database system used in R/3.                                                                               
    Possible errors:                                                        
    o The maximum size of an SQL statement has been exceeded.              
    o The statement contains too many input variables.                     
    o The space needed for the input data exceeds the available memory.    
    o ...                                                                               
    You can usually find details in the system log (SM21) and in the        
    developer trace of the work process (ST11).                             
    If an error occurs the developer trace often informs you about the      
    current restrictions.                                                   
    So now i want to fine tune the program so that the execution works perfectly and get me the values for all the data 1500000 :-|
    Now :
    My Projects are stored in the form of a range R_Range
    I have to loop at this range and then process 100 records at a time and then again take other 100 records .... i'll count till 100 records by getting loopaing at the range and for each loop pass i'll increment the counter ....
    I am clear till this .....
    If record consist of 'EQ' option .... then ofcourse we can consider the total record to be 1 record and we can add 1 to counter ......
    But if the record consist of 'BT' option ...... then how can we loop that and get the number of -low numbers in that range and add to my counter ????
    Hope iam clear with my question
    If not do revert back ....
    Thanks in advance for the replies
    Cheers,
    R.Kripa.
    My Doubt is ....

  • How do we use if statement in labview?moreover can i use if statement inside for loop?

    how do we use if statement in labview?moreover can i use if statement inside for loop?

    The if statement in LabVIEW is the Case structure. You can find that on the Structures palette right next to the For Loop. If you're still on the same subject about terminating a for loop early, then what you do is enclose your functions inside the loop with a case statment and make one of the case's empty except for one or more constants that you might have to wire. Hopefully, the attached picture will explain what I mean. Also, as I mentioned in one of your other posts, I think this technique is not as good as using a while loop. The array in the attached example is the same size no matter what and you may have to handle stripping extra or invalid elements.
    Attachments:
    For_Loop_with_Case.jpg ‏21 KB

  • I brought a macbook pro, but i can not use my apple id.because its already register onther account.i couldnt found that person.i want reset that account,can tell me how can i do this?

    i brought a macbook pro, but i can not use my apple id.because its already register onther account.i couldnt found that person.i want reset that account,can tell me how can i do this?

    maxsurovi wrote:
    i brought a macbook pro, but i can not use my apple id.because its already register onther account.i couldnt found that person.i want reset that account,can tell me how can i do this?
    Restore the Mac to Factorty settings to make it Truly Yours.
    Note:
    This should have been done before you took possession...
    Apple What to do before selling or giving away your Mac
    http://support.apple.com/kb/HT5189?viewlocale=en_US&locale=en_US
    Also See Thomas Reed's How to Prepare your Mac for sale

  • DBCA can not use ASM for database storage due to following reason: Could no

    Hi
    I've a recently installed RAC11gR2(11.2.0.3) on HP-UX
    I installed Grid Infrastructure with grid user:
    Node1: # id grid
    uid=1100(grid) gid=1000(oinstall) groups=1031(dba),1021(asmdba)
    Node2: # id grid
    uid=1100(grid) gid=1000(oinstall) groups=1031(dba),1021(asmdba)
    I installed the Oracle Server with oracle user:
    Node1: # id oracle
    uid=1101(oracle) gid=1000(oinstall) groups=1031(dba),1021(asmdba),1033(oper)
    Node2: # id oracle
    uid=1101(oracle) gid=1000(oinstall) groups=1031(dba),1021(asmdba),1033(oper)
    All related Grid Infrastructure is functioning well in both nodes:
    $ crs_stat -t
    Name Type Target State Host
    ora.DATA.dg ora....up.type ONLINE ONLINE node03
    ora.FRA.dg ora....up.type ONLINE ONLINE node03
    ora....ER.lsnr ora....er.type ONLINE ONLINE node03
    ora....N1.lsnr ora....er.type ONLINE ONLINE node04
    ora.asm ora.asm.type ONLINE ONLINE node03
    ora.cvu ora.cvu.type ONLINE ONLINE node04
    ora.gsd ora.gsd.type OFFLINE OFFLINE
    ora....network ora....rk.type ONLINE ONLINE node03
    ora.oc4j ora.oc4j.type OFFLINE OFFLINE
    ora.ons ora.ons.type ONLINE ONLINE node03
    ora.scan1.vip ora....ip.type ONLINE ONLINE node04
    ora....SM1.asm application ONLINE ONLINE node03
    ora....03.lsnr application ONLINE ONLINE node03
    ora....d03.gsd application OFFLINE OFFLINE
    ora....d03.ons application ONLINE ONLINE node03
    ora....d03.vip ora....t1.type ONLINE ONLINE node03
    ora....SM2.asm application ONLINE ONLINE node04
    ora....04.lsnr application ONLINE ONLINE node04
    ora....d04.gsd application OFFLINE OFFLINE
    ora....d04.ons application ONLINE ONLINE node04
    ora....d04.vip ora....t1.type ONLINE ONLINE node04
    $
    The ASM instance are running well in both nodes
    Connected with oracle user, the listener has registered perfectly the ASM instance in each node:
    $
    $ lsnrctl status
    LSNRCTL for HPUX: Version 11.2.0.3.0 - Production on 16-MAY-2012 15:41:06
    Copyright (c) 1991, 2011, Oracle. All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for HPUX: Version 11.2.0.3.0 - Production
    Start Date 16-MAY-2012 15:24:19
    Uptime 0 days 0 hr. 16 min. 47 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
    Listener Log File /u01/app/grid/diag/tnslsnr/node03/listener/alert/log .xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=16.0.0.133)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=16.0.0.136)(PORT=1521)))
    Services Summary...
    Service "+ASM" has 1 instance(s).
    Instance "+ASM1", status READY, has 1 handler(s) for this service...
    The command completed successfully
    $
    $
    DATA & FRA disk group are created:
    $
    $ echo $ORACLE_SID
    +ASM1
    $
    $ asmcmd
    ASMCMD>
    ASMCMD> ls -lt
    State Type Rebal Name
    MOUNTED EXTERN N DATA/
    MOUNTED EXTERN N FRA/
    ASMCMD>
    ASMCMD>
    The big issue is... that the DBCA can not see the diskgroups. When I choose ASM Storage it can not see them. It shows the chart in blank and if i try to write the disk group, so the following message appears: can not use ASM for database storage due to following reason: Could not connect to ASM due to following error: ORA-01034 ORACLE not available
    What can be passing in this case... ?
    Thanks in advance

    Thanks both
    Really the problem initially was because of this:
    [INS-06006] Passwordless SSH connectivity not set up between the following node(s): [node1, node2]. CVU may reports "PRVF-4007 : User equivalence check failed for user "user"" for same error
    and I had to install node1 first and after node2 manually and perhaps for this the product was not well linked.
    I resolved the problem establishing the keys with the wizard and after copying the following files from node1 to node2
    /home/grid/.ssh -------> /home/grid/.ssh
    authorized_keys
    known_hosts
    This is the procedure if you run the wizard at the node1.
    The problem is that the wizard creates the keys incompletely...
    Thanks

  • Have been having issues with firefox crashing & v e r r y s l o w also sluggish, I removed by the programs & features than redownloaded it, I can not use it.

    Had to remove it for the last & final time. I love & miss my Firefox, but can't take the chance of someone getting into my system. The upgrade had yahoo toolbar which is always easy to get rid of (thank God) but I have this yellow sign in my popup that says something about the system not being safe, & we can not go to any web sites. Why is it everything that is upgraded always turns out to be BULL. I can not use Firefox for anything, so once again had to remove it using the programs & features update/remove. Windows7 Home Premium 64-bit Operating System. HELP.

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your bookmarks, history, passwords, cookies, and other essential information.
    '''''Note:''' After resetting Firefox, you will lose any extensions, toolbar customizations, and some preferences.'' See the [[Reset Firefox – easily fix most problems]] article for more information.
    To Reset Firefox:
    # Open the Troubleshooting Information page using one of these methods:
    #*Click the menu button [[Image:New Fx Menu]], click help [[Image:Help-29]] and select ''Troubleshooting Information''. A new tab containing your troubleshooting information should open.
    #*If you're unable to access the Help menu, type '''about:support''' in your address bar to bring up the Troubleshooting Information page.
    #At the top right corner of the page, you should see a button that says "Reset Firefox" that looks like this: [[Image:Button reset]]. Click on it.
    #Firefox will close and reset. After it is done, Firefox will show a window with the information that is imported.
    #Click Finish and Firefox will reopen.
    Did this fix the problem? Please report back to us!

  • Problem in inserting to MS Access using prepared statement

    I am inserting a record in MS Access db and I am using prepared statement. I am encountering an error.... any help I would really appreciate it. So much time figuring out what the problem is....
    ConvertText contxt = new ConvertText();
    String bday = (String)cbYear.getSelectedItem() +
    cbMonth.getItemCount()+(String)cbDay.getSelectedItem();
    try{
    // load MySQL driver
    Class.forName(driver);
    // Setup connection to DBMS
    Connection conn = DriverManager.getConnection(url);
    // Create statement     
    Statement stmt     = conn.createStatement();
    PreparedStatement insertPersons = conn.prepareStatement(
            "INSERT INTO PERSONS VALUES(" +
         "FIRST_NAME               = ?," +
         "LAST_NAME              = ?," +
         "MIDDLE_NAME               = ?," +
         "NICKNAME              = ?," +
         "GENDER              = ?," +
         "MARITALSTATUS           = ?," +
         "AGE                    = ?," +
         "BIRTHDATE                   = ?," +
         "ADDRESS                  = ?," +
         "RES_PHONE_NUMBER        = ?," +
         "OFFICE_PHONE_NUMBER     = ?," +
         "CELL_NUMBER               = ?," +
         "COMPANY_NAME               = ?," +
         "EMAIL_ADDRESS               = ?," +
         "TIMESTAMP               = ?)"
              insertPersons.setString   (1, tfFirstName.getText());
              insertPersons.setString   (2, tfLastName.getText());
              insertPersons.setString   (3, tfMiddleName.getText());
              insertPersons.setString   (4, tfNickName.getText());
              insertPersons.setString   (5, (String)cbGender.getSelectedItem());
              insertPersons.setString   (6, (String)cbMaritalStatus.getSelectedItem());
              insertPersons.setInt      (7, contxt.formatStringToInt(tfAge.getText()));
              insertPersons.setDate     (8, contxt.formatStringToSQLDate(bday));
              insertPersons.setString   (9, tfAddress.getText());
              insertPersons.setString   (10,tfResPhoneNumber.getText());
              insertPersons.setString   (11,tfOffPhoneNumber.getText());
              insertPersons.setString   (12,tfCellNumber.getText());
              insertPersons.setString   (13,tfCompanyName.getText());
              insertPersons.setString   (14,tfEmailAddress.getText());
              insertPersons.setTimestamp(15, new Timestamp(System.currentTimeMillis()));          
              insertPersons.executeUpdate();
              conn.close();          
    JOptionPane.showMessageDialog(null,"Record Inserted!", "INSERT",
                        JOptionPane.INFORMATION_MESSAGE);
    }catch (SQLException ex){
    System.err.println("==> SQLException: ");
    System.out.println("Message:   SQL Exception");
    System.out.println("Message:   " + ex.getMessage ());
    System.out.println("SQLState:  " + ex.getSQLState ());
    System.out.println("ErrorCode: " + ex.getErrorCode ());
    JOptionPane.showMessageDialog(null, ex.getMessage() + ex.toString(),"Error", JOptionPane.INFORMATION_MESSAGE);
    }catch(Exception ex){
    }          ERROR Displayed:
    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 30. java.sql.SQLException     

    Hi cruzdhel,
    Your SQL looks incorrect to me.
    I am not familiar with that syntax.
    I think it should be like this:
    PreparedStatement insertPersons =
    conn.prepareStatement("INSERT INTO PERSONS (FIRST_NAME," +
                                               "LAST_NAME," +
                                               "MIDDLE_NAME," +
                                               "NICKNAME," +
                                               "GENDER," +
                                               "MARITALSTATUS," +
                                               "AGE," +
                                               "BIRTHDATE," +
                                               "ADDRESS," +
                                               "RES_PHONE_NUMBER," +
                                               "OFFICE_PHONE_NUMBER," +
                                               "CELL_NUMBER," +
                                               "COMPANY_NAME," +
                                               "EMAIL_ADDRESS," +
                                               "TIMESTAMP)" +
    "values (?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?," +
            "?)");Hope this helps.
    Good Luck,
    Avi.

  • How to use prepared statement - For Everyone Help

    public String count()
    int count = 0;
    String fetchsize = "";
    try
    Connection conn = getOADBTransaction().getJdbcConnection();
    Statement statement = conn.createStatement();
    String Query = "select count(*) count from fnd_lookups where lookup_type like 'SAPE_BILL_TO_SHIP_TO_UPDATE'";
    ResultSet resultset = statement.executeQuery(Query);
    while (resultset.next())
    count = (int)resultset.getInt("count");
    fetchsize = ""+count;
    catch(Exception e)
    return fetchsize;
    }

    Hi,
    we can use prepare statement in Co....
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    try
    PreparedStatement prpdStmt1 = am.getOADBTransaction().getJdbcConnection().prepareStatement("select full_name from per_all_people_f where person_id='"+empid+"' ");
    ResultSet rs=prpdStmt1.executeQuery(); //Cursor fetch row
    while(rs.next())
    empname=rs.getString(1);
    catch(Exception e)
    System.out.println("Exception is"+e.getMessage());
    t1.setValue(pageContext,empname);
    Thanks
    nani

  • Query slow when executing using prepared statement compared to sqlDeveloper

    Oracle version is 10.2.0.1.0.
    I have got a query which when submitted from java code using prepared statement and parameter substitutions, takes more than 20 seconds to give results.
    I can see this SELECT sql sitting there when I run Monitor Sessions through sqlDeveloper, with its wait time increasing and then finally getting through. During that time no other SQLs are waiting.
    DURING THAT TIME then I am able to run the same query (with values included) multiple times using sqlDeveloper, and it gives results in no time.
    Sqldeveloper connects using thin client using lib provided by oracle in windows.
    Java code runs from linux and uses the thin client using lib provided by oracle in linux.
    Both are hitting the same DB running on a separate Linux machine.
    What could be the cause of this problem?
    What db parameters, queries should I run to identify the bottleneck?
    Edited by: user10390517 on Jun 14, 2010 3:06 AM

    Hi Rob,
    at least you should see some differences in the statistics for the different child cursor (the one for the execution in the application should show at least a higher value for ELAPSED_TIME). I would use something like the following query to check the information for the child cursors:
    select sql_id
         , PLAN_HASH_VALUE
         , CHILD_NUMBER
         , EXECUTIONS
         , ELAPSED_TIME
         , USER_IO_WAIT_TIME
         , CONCURRENCY_WAIT_TIME
         , DISK_READS
         , BUFFER_GETS
         , ROWS_PROCESSED
      from v$sql
    where sql_id = your_sql_idRegards
    Martin

  • How to Insert Character using Prepared statement

    Hi All,
    Can anyone let me know how can I insert character using prepared statement.
    Thanks
    Sameer

    In the future JDBC related questions should be posted into the JDBC forum.
    Can you please provide some more information about what you are trying to do? It isn't clear to me. Are you trying to update a CHAR field?

  • Can I use case statements in triggers?

    I created this trigger, it works BUT I don't like those parentheses at the begining, I would like
    to change those parentheses for case statements, well that is my question, can you use case statements in triggers, how you would translate the following in case statement?
    FOR EACH ROW
    WHEN ( (new.sgbstdn_levl_code = 'UG')
    and
    ( (NEW. SGBSTDN_STST_CODE NOT IN ('GR','SA','AS','IS') )
    OR
    ( (NEW. SGBSTDN_STST_CODE = 'IS' ) AND
    (NEW. SGBSTDN_STYP_CODE IN ('N' , 'T' )) AND
    (OLD. SGBSTDN_STST_CODE = 'AS' ) ) ) )
    ==================================================================================================
    CREATE OR REPLACE TRIGGER CC_STUD_WITHDRAWAL
    AFTER UPDATE OR INSERT ON SATURN . SGBSTDN
    FOR EACH ROW
    WHEN ( (new.sgbstdn_levl_code = 'UG')
    and
    ( (NEW. SGBSTDN_STST_CODE NOT IN ('GR','SA','AS','IS') )
    OR
    ( (NEW. SGBSTDN_STST_CODE = 'IS' ) AND
    (NEW. SGBSTDN_STYP_CODE IN ('N' , 'T' )) AND
    (OLD. SGBSTDN_STST_CODE = 'AS' ) ) ) )
    DECLARE
    v_params gokparm.t_parameterlist;
    event_code gtveqnm.gtveqnm_code%TYPE;
    firstname spriden.spriden_first_name%TYPE;
    lastname spriden.spriden_last_name%TYPE;
    middlename spriden.spriden_mi%TYPE;
    id spriden.spriden_id%TYPE;
    CURSOR get_stud_name IS
    SELECT
    spriden_id ,
    spriden_last_name ,
    spriden_first_name ,
    spriden_mi
    FROM
    saturn.spriden
    WHERE spriden_pidm = :NEW.SGBSTDN_PIDM
    AND spriden_change_ind IS NULL;
    BEGIN
    IF goksyst . f_isSystemLinkEnabled ( 'WORKFLOW' ) THEN
    event_code := SUBSTR ( gokevnt.F_CheckEvent ( 'WORKFLOW' ,'CC_STUDENT_WITHDRAW' ),1,20);
    OPEN get_stud_name ;
    FETCH get_stud_name INTO id , lastname , firstname , middlename ;
    CLOSE get_stud_name ;
    ----pass parameters to the event
    v_params ( 1 ).param_value := 'CC_STUDENT_WITHDRAW' ;
    v_params ( 2 ).param_value := '' ;
    v_params ( 3 ).param_value := 'Student Withdrawal:' || lastname || ',' || firstname || ' ' ||
    middlename ;
    v_params ( 4 ).param_value := :NEW.sgbstdn_pidm ;
    v_params ( 5 ).param_value := id ;
    v_params ( 6 ).param_value := lastname ;
    v_params ( 7 ).param_value := firstname ;
    v_params ( 8 ).param_value := middlename ;
    v_params ( 9 ).param_value := :NEW.sgbstdn_term_code_eff ;
    v_params ( 10 ).param_value := :NEW.SGBSTDN_STST_CODE ;
    v_params ( 11 ).param_value := :NEW.SGBSTDN_STYP_CODE ;
    gokparm.Send_Param_List ( event_code , v_Params );
    END IF;
    END;
    /

    You could delete a fair number of extraneous parentheses.
    CREATE OR REPLACE TRIGGER cc_stud_withdrawal
      AFTER UPDATE OR INSERT
      ON saturn.sgbstdn
      FOR EACH ROW
      WHEN     NEW.sgbstdn_levl_code = 'UG'
           AND (   NEW.sgbstdn_stst_code NOT IN ('GR', 'SA', 'AS', 'IS')
                OR (    NEW.sgbstdn_stst_code = 'IS'
                    AND NEW.sgbstdn_styp_code IN ('N', 'T')
                    AND OLD.sgbstdn_stst_code = 'AS'))

Maybe you are looking for

  • Failed to delete file after processing FTP

    Failed to delete file after processing. The FTP server returned the following error message: 'com.sap.ai i.adapter.file.ftp.FTPEx: 550 Unexpected reply code *.txt: The process cannot access the file because it is being used by another process. '. For

  • How to fix a Nonresponse Left-Click on a  Magic Mouse

    First, this posting is not a problem but a solution to a problem with the OS X 10.6 System Preference/Mouse/Double-Click setting. I have a new Magic Mouse and it was non responsive on normal every day left-clicks. It got so bad I was having to go to

  • Exporting data to a csv file and include column names

    I am creating a SSIS package which creates a .csv file.  The package works fine except it is not putting the column names as the first row. How do I get the column names to also export? Thanks, ~John

  • In snow leopard where are the pages

    When I went to get my laptop cleaned up at apple they told me that pages and like the version of excel, but I have not been able to find it. Can someone help me ?

  • Wanted to have all previous 6 Months name in sequence....

    Hi I am using BI BEx Designer tool for generating a report on month basis having 0CalMonth on column side like Jan'10 to Jul'10. Now the problem is if there is no transaction for any month then we wont' get that month name in the report, but i wanted