Query SQL database using JSF problem!! Using CachedRowSet

I'm using JSF and want to query data from SQL by using CachedRowSet like this,
rowset.setCommand("SELECT * FROM dbo.SomeTable WHERE SomeField='"+ xyz +"'");
then check if the record does exist by using
*if(rowset.next()) {/ do something with the retrieved data}*
but i get SQLException telling that execute() never called.
Anyone can tell me what i'm missing? or is there any better way to check the existence of a record ?
Thanks in advance :-)

Hi grzegorz,
1. If your sap application server is unix/aix
  (and not a microsoft OS),
2. then this kind of secondary databse connection,
   to MS SQL (which is microsoft system),
   is at present not possible.
  (BCOS the required system files, for such
   cross - platform connection is not delivery by sap)
regards,
amit m.

Similar Messages

  • Query SQL database inside XSL

    Do you guys know how can I query SQL database select records and input them to XSL file?
    Let me know this is urgent.

    Is there an efficient way of doing this, rather than
    hardcoding all the less than,greater than lines?Sounds like you need to read this:
    http://java.sun.com/webservices/docs/1.1/tutorial/doc/index.html

  • How can I transfer a XML file content to a MS SQL database by stored procedure using LabWindows/CVI SQL Toolkit?

    Hi,
    I have a problem to transfer a XML file content to a MS SQL database by a given/fixed stored procedure. I'm able to transfer the content of the file by using following method ...
    hstmt = DBPrepareSQL (hdbc, EXEC usp_InsertReport '<Report> ..... </Report>');
    resCode = DBExecutePreparedSQL (hstmt);
    resCode = DBClosePreparedSQL (hstmt);
    ... but in this case I'm not able to fetch the return value of the stored procedure! 
    I have tried to follow the example of the stored procedure in the help documentation (DBPrepareSQL) but I miss a datatype for xml?!?
    Any idea how to solve my problem?
    KR Cake  
    Solved!
    Go to Solution.

    After some additional trials I found a solution by calling the stored procedure in this way
    DBSetAttributeDefault (hdbc, ATTR_DB_COMMAND_TYPE, DB_COMMAND_STORED_PROC);
    DBPrepareSQL (hdbc, "usp_InsertReport");
    DBCreateParamInt (hstmt, "", DB_PARAM_RETURN_VALUE, -1);
    DBCreateParamChar (hstmt, "XMLCONTENT", DB_PARAM_INPUT, sz_Buffer, (int) strlen(sz_Buffer) + 1 );
    DBExecutePreparedSQL (hstmt);
    DBClosePreparedSQL (hstmt);
    DBGetParamInt (hstmt, 1, &s32_TestId);
    where sz_Buffer is my xml file content and s32_TestID the return value of the stored procdure (usp_InsertReport(@XMLCONTENT XML))
    Now I face the problem, that DBCreateParamChar limits the buffer size to 8000 Bytes.
    Any idea to by-pass this shortage??

  • Query SQL database with Crystal

    I have a crystal report that is a production work order from our ERP system Macola ES.  The user enters the work order in Macola then prints it.  The user will input a work order number and the report will populate multiple fields from that work order.  To be specific I am trying to add a field on the report that will display the most recently entered batch number for the item number that is in the work order.
    item_no = Field 7 in the report
    The t-sql below above achieves what I would like to display on the report when searching the database.  The text after /* and before */ are my comments.
    /* Search for the most recent order entered in the ppordfil_sql database
    where the item number equals Field7 */
    select top 1
    cus_name /* Batch number field */
    from dbo.ppordfil_sql
    where ppordfil_sql.item_no = "Crystal Report Field 7"
    order by entered_dt desc

    Yes Macola is partner of ours.  However, they are not going to write the Crystal Report for us.  The question I am asking is how I can query an SQL database to display and create a query of the SQL data in my report.  I know how to write the t-sql as shown above.  The field "Crystal Report Field 7" is the field I would like to base my query off.  I was hoping someone could point me in the right direction with using a combination of a command object and a parameter.

  • BSP to query Sql database?

    Just curious to find out if this is an option..
    We web AS 6.40, can we write in ABAP to query data from a SQL database?
    Thanks in advance..
    Vince

    Yes.
    if you can eloborate little more on what you are trying to do, we can be helpful.
    Regards
    Raja

  • OBIEE Report using webservices : problem using the htmlviewservice.

    Hi,
    I have a requirement that i have to display OBIEE report on web browser.
    i followed the following article for achieving this. http://oraclebizint.wordpress.com/2007/07/31/customizing-obi-ee-soap-api/.
    I have a problem while creation of the html page.
    the given sample code consists the following.
    startIndex = htmlOutput.indexOf("IFRAME SRC=");
    endIndex = htmlOutput.indexOf("%3aEI Index",startIndex);
    startIndex = startIndex + 12;
    endIndex = endIndex + 10;
    System.out.println("start Index ="+ startIndex+"\n"+"end Index ="+endIndex);
    url ="<HTML><BODY><IFRAME SRC=\"" +htmlOutput.substring(startIndex,endIndex) +"\"></BODY></HTML>";
    But i didn't understand the given lines of the code. I tried a code like url = "<HTML><BODY>"+ headerHTML+htmlOutput + "</BODY></HTML>";
    I am able to get the reportId, sessionId, pageId. After creation of the html page, it always display a rotating clock.
    please help me how to get the report on html page with the url.
    Thanks in advance.
    Udaykiran.
    Edited by: UdayKiran on Sep 28, 2011 3:31 PM

    Oracle accepted this as a Bug
    Bug 14606826 - SOAP CALL FROM EXTERNAL JAVA APPLICATION TO OBIEE11G NOT RETURNING ANY DATA

  • Using JSF and Struts

    I am a bit of a newbie in terms of UI applications on the JEE platform, so I apologize up front if this question seems silly. I was wondering if someone could comment on the approach below. Is this something that's possible or am I barking up the wrong tree?
    We have a vendor application that is written using Struts. We want to add a section of our own pages to this application, but we would rather use a more strategic approach in our pages, so we would like to use JSF for those.
    The original web.xml file in the vendor app uses a dtd of version 2.3 as shown below:
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    When I use JSF, I use a DTD version of 2.5 as shown here:
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    The problem is that when I use version 2.3, the elements needed to support JSF are invalid. When I use 2.5, the elements needed to support struts are invalid.
    Could someone comment in that, if you had this vendor app and you needed to add your own pages, is it not possible to use JSF in this scenario or if you can, what is the best approach to resolving this issue?
    Thank you in advance

    First make sure that your application server supports Servlet API 2.5. Whether the desired Servlet API version is supported or not solely depends on the application server implementation and version used. For example Tomcat 5.5 is a Servlet API 2.4 implementation which only supports the API versions up to with 2.4. If you want to use Servlet API 2.5, then you obviously need a Servlet API 2.5 implementation, for example Tomcat 6.0.
    Consult the website and/or documentation of the application server in question.

  • Consistently getting "The wait operation timed out" when connecting to Azure SQL Database from a virtual instance...

    I have a web app that is backed by a an Azure SQL Database. The problem is that I had multiple issues when connecting to the database mainly when trying to establish a connection, or timeouts. This is the log I just encountered when trying to use the web
    app.
    [Win32Exception (0x80004005): The wait operation timed out]
    [SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=21970; handshake=1; ]
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +671
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116
    System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1012
    System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +6712291
    System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +152
    System.Data.SqlClient.SqlConnection.Open() +229
    System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +102

    Hi Affar2k,
    According to your description, we need to verify if there is no network issue and the Sqlclient version is older than .NET 4.5.  You can try to connect to the Windows Azure SQL database via SSMS and check if it can run well. When you
    connect to the SQL Azure database via ADO.NET, you need to verify that the server name and passwords are right in the connection string.
    For more information, you can review the following article about how to connect to Windows Azure SQL Database using ADO.NET.
    http://msdn.microsoft.com/en-us/library/windowsazure/ee336243.aspx
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How to Deploy Mysql database with JSF Application

    hi,
    I have developed web application using JSF which uses a MySQL as Database.The server is localhost, database name is database_123(or watever!), so everything works fine...now this web application is something which i need to run on other computers as well....so do i have to install mySQL server to the computer from which the war file is deployed? if i don't want to install mysql at any computer, then how can i do?
    Plz help me! and if possible please tell me or post a article.
    Thanx in advance
    jsfgeeks

    This is what I am trying to figure out what is the best way. I am not worrying about making the SQL Server part of my install, we are going to leave that up to the client. I already have the script to create the DB, I am just trying to find the best way to deliver the data to the SQL Server. Like I said I have T-SQL scripts with insert statements but they end up being huge. I am looking at maybe using ApexSQL Script, as it can make an .exe file that creates the DB and installs the data, but it give me an out of memory error because we have so much data.

  • Assign locals from SQL-database

    How to assign locals from SQL-database and how to use locals in SQL-statement.

    There's a shipping example called WritingAndReadingTableData.seq (in v2.0 anyway) that should help. In the example, a Data Operation of Get, reads a column value and writes it to a local variable. You can insert a local variable into the SQL statement that you create in the Open SQL Statement step type. In the above example, there's the statement
    "SELECT TEST_TABLE.COL_COUNTER, TEST_TABLE.COL_STRING, TEST_TABLE.COL_INTEGER, TEST_TABLE.COL_DOUBLE, TEST_TABLE.COL_CURRENCY, TEST_TABLE.COL_BOOLEAN, TEST_TABLE.COL_DATE FROM TEST_TABLE"
    If you had a local variable called TableName and value of "TEST_TABLE" assinged to it, the statement could just as easily be
    "SELECT TEST_TABLE.COL_COUNTER, TEST_TABLE.COL_STRING, TEST_TABLE.COL_INTEGER, TEST_TABLE.COL_DOUB
    LE, TEST_TABLE.COL_CURRENCY, TEST_TABLE.COL_BOOLEAN, TEST_TABLE.COL_DATE FROM " + locals.TableName

  • Access Report Link to SQL database

    Hi,
    I have been designing a report interface in Access that is supposed to retrieve data from an SQL Database. The problem is that i don't know how to connect the two so that it (report) retrieves data from the database. How do I connect the two?
    martin

    Hi breakage,
    Based on my understanding, you want to connect to a SQL Server database on Access side, then retrieve the data from the database.
    When connecting to a SQL Server database, Access creates a new table (linked table), and it's structure and contents are corresponding to the source object. In your scenario, you can open the Access database in which you want to create the linked tables,
    then choose External Data tab. With the wizard, you can link the expected SQL Server database. For more information, please refer to the
    Link to SQL Server data section of this article:
    Import or link Access to SQL Server data .     
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Problem using a SQL database Catalogue to insert data to a table

    I am developing with Version:
    10.3.1.0, Build: #99765....
    as part of a step in my process I need to store some data in an audit table.
    I have setup the SQL Catalogue entry and then use the following code:
    sentMail is defined as a local variable
    sentMail = RSPCA.Resources.RSPCA.R_SENTEMAIL()
    sentMail.sentemailBody = sendInternalRequest.htmlbody
    sentMail.sentemailDatesent = Fuego.Lang.Time
    sentMail.sentemailSubject = subject
    sentMail.sentemailTo = creation.participant.email
    sentMail.sentemailType = "People"
    store sentMail
    This works if I comment out this line:
    sentMail.sentemailBody = sendInternalRequest.htmlbody
    The issue I'm having maybe something to do with the size of the data, in oracle the field is a varchar2(4000) and it looks like the catalogue treats it as a String(4000), if I make sure I only put around 1500 characters in the field it works, but as soon as I put all in from my test data (about 2300) it fails with this message:
    The method 'CIL_sendToHQ' from class 'EstablishmentManagement.EMMaintainPeopleProcess.Default_1_0.Instance' could not be successfully executed.
    Caused by: [BEA][Oracle JDBC Driver][Oracle]ORA-01461: can bind a LONG value only for insert into a LONG column
    Caused by: [BEA][Oracle JDBC Driver][Oracle]ORA-01461: can bind a LONG value only for insert into a LONG column
    fuego.lang.ComponentExecutionException: The method 'CIL_sendToHQ' from class 'EstablishmentManagement.EMMaintainPeopleProcess.Default_1_0.Instance' could not be successfully executed.
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:519)
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:273)
         at fuego.fengine.FEEngineExecutionContext.invokeMethodAsCil(FEEngineExecutionContext.java:219)
         at fuego.server.execution.EngineExecutionContext.runCil(EngineExecutionContext.java:1278)
         at fuego.server.execution.microactivity.ComponentExecutionMicroActivity.runCil(ComponentExecutionMicroActivity.java:126)
         at fuego.server.execution.microactivity.ComponentExecutionMicroActivity.execute(ComponentExecutionMicroActivity.java:84)
         at fuego.server.execution.microactivity.MicroActivityEngineExecutionHandler.executeActivity(MicroActivityEngineExecutionHandler.java:57)
         at fuego.server.execution.ImmediateActivity.execute(ImmediateActivity.java:42)
         at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
         at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:470)
         at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:551)
         at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
         at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
         at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:62)
         at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42)
         at fuego.server.execution.ToDoItem.executeAutomaticWork(ToDoItem.java:251)
         at fuego.server.execution.ToDoItem.run(ToDoItem.java:536)
         at fuego.component.ExecutionThread.processMessage(ExecutionThread.java:775)
         at fuego.component.ExecutionThread.processBatch(ExecutionThread.java:755)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:142)
         at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:134)
         at fuego.fengine.ToDoQueueThread$PrincipalWrapper.processBatch(ToDoQueueThread.java:450)
         at fuego.component.ExecutionThread.work(ExecutionThread.java:839)
         at fuego.component.ExecutionThread.run(ExecutionThread.java:408)
    Caused by: fuego.components.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01461: can bind a LONG value only for insert into a LONG column
         at fuego.sql.TableSQLObject.implicitStore(TableSQLObject.java:409)
         at fuego.sql.TableSQLObject.store(TableSQLObject.java:340)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at fuego.lang.JavaClass.invokeMethod(JavaClass.java:1410)
         at fuego.sql.SQLObject.invoke(SQLObject.java:364)
         at fuego.lang.Invokeable.invokeImpl(Invokeable.java:234)
         at fuego.lang.Invokeable.invokeDynamic(Invokeable.java:188)
         at EstablishmentManagement.EMMaintainPeopleProcess.Default_1_0.Instance.CIL_sendToHQ(Instance.xcdl:100)
         at EstablishmentManagement.EMMaintainPeopleProcess.Default_1_0.Instance.CIL_sendToHQ(Instance.xcdl)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:512)
         ... 23 more
    Caused by: java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01461: can bind a LONG value only for insert into a LONG column
         at albpm.jdbc.base.BaseExceptions.createException(Unknown Source)
         at albpm.jdbc.base.BaseExceptions.getException(Unknown Source)
         at albpm.jdbc.oracle.OracleImplStatement.execute(Unknown Source)
         at albpm.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at albpm.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
         at albpm.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
         at fuego.jdbc.FaultTolerantPreparedStatement.executeUpdate(FaultTolerantPreparedStatement.java:623)
         at fuego.sql.TableSQLObject.insert(TableSQLObject.java:626)
         at fuego.sql.TableSQLObject.implicitStore(TableSQLObject.java:391)
         ... 39 more
    Edited by: user10778731 on 21-Jan-2010 06:17

    Suspect you're not going to like this answer, but I never use the store() method for a database heir object anymore.
    The store() database method has been broken and then fixed and then broken again on too many release cycles to trust that it will work consistently as MPs/Hotfixes are applied. I'd suspect that your "String(4000)" problem might also be related to using the store() method.
    Others will probably disagree, but only use the OOTB PBL (JDBC) SQL or Dynamic SQL in the PBL logic. In your case, I think you might be best served by using Dynamic SQL. With Dynamic SQL you don't run into the shortcomings of JDBC SQL (String(4000) might be one of them) and you can then test / debug your SQL in your favorite DB tool of choice first (e.g. Toad, Squirrel, Sql Plus). Once successfully tested, you can then paste it back into your PBL.
    Dan

  • Query regarding connecting dashboards with SQL DATABASE using WSDT

    Hello Sir,
    I am trying to connect dashboards with Sql database via WSDT, but i have encountered the same problem as described in your SAP community blog (SAP Web Service Design Tool: From web service creation to Xcelsius consumption).
    when i tried connecting CR server with WSDT ,it still shows that total number of available licenses is 0.
    What can be done to solve this issue.
    for your detail reference, we are using CRS NUL version's 60 days Evaluation keys and same with Xcelsius Departmental edition.
    I would really appreciate, if you revert back to my mail as soon as possible

    Which version of Crystal Reports are you using? The regular ReportDocument SDK probably isn't robust enough to handle this, unless you create a connection using that connection string at design-time which you don't change at runtime. You might be able to add those properties using the in-proc RAS SDK, though. This is available with CRXI R2 as of SP2, and CR2008.

  • Problem using DECODE() function with a Query of Queries

    I
    posted
    on my blog about an issue I was having trying to use the PL/SQL
    DECODE() function with a Coldfusion Query of Queries. This function
    works fine when you query a database for information. However, when
    you query another query, it seems that CF doesn't recognize it. I
    got errors stating that it found a left parenthesis where it
    expected a FROM key word. Here is a simplified version of what I am
    trying to do:
    quote:
    <!--- Simulated query; similar to what I was calling from
    my database --->
    <cfscript>
    qOriginal = queryNew("Name,Email,CountryCode",
    "VarChar,VarChar,VarChar");
    newRow = queryAddRow(qOriginal, 5);
    querySetCell(qOriginal, "Name", "Joe", 1);
    querySetCell(qOriginal, "Email", "[email protected]", 1);
    querySetCell(qOriginal, "CountryCode", "AMER", 1);
    querySetCell(qOriginal, "Name", "Sally", 2);
    querySetCell(qOriginal, "Email", "[email protected]", 2);
    querySetCell(qOriginal, "CountryCode", "AMER", 2);
    querySetCell(qOriginal, "Name", "Bob", 3);
    querySetCell(qOriginal, "Email", "[email protected]", 3);
    querySetCell(qOriginal, "CountryCode", "ASIA", 3);
    querySetCell(qOriginal, "Name", "Mary", 4);
    querySetCell(qOriginal, "Email", "[email protected]", 4);
    querySetCell(qOriginal, "CountryCode", "EURO", 4);
    querySetCell(qOriginal, "Name", "John", 5);
    querySetCell(qOriginal, "Email", "[email protected]", 5);
    querySetCell(qOriginal, "CountryCode", "EURO", 5);
    </cfscript>
    <cfquery name="qCountries" dbtype="query">
    SELECT DISTINCT(CountryCode) AS CountryCode,
    DECODE(states, "AMER", "North America &amp; Canada",
    "EURO", "Europe &amp; Africa", "ASIA", "Japan &amp;
    Asia","") CountryName
    FROM qOriginal
    ORDER BY CountryCode
    </cfquery>
    <cfdump var="#qCountries#">
    <!--- ========== END OF CODE ========== --->
    So running this returned the following error:
    Query Of Queries syntax error.
    Encountered "(. Incorrect Select Statement, Expecting a
    'FROM', but encountered '(' instead, A select statement should have
    a 'FROM' construct.
    Does anybody know why this doesn't work? Is it just not
    supported? Please note that I have also tried to use the CASE()
    function instead of DECODE() and that resulted in basically the
    same error. For now I an looping over my distinct query with a
    switch statement and manually loading a new query with the data how
    I want it. But it would be a lot cleaner and less code to have the
    DECODE() to work. Thx!

    DECODE() is an Oracle function, not generic SQL. Q-of-Q is a
    very limited subset of SQL and lacks many functions and clauses
    available in standard SQL, especially what you may be used to using
    in your particular RDBMS.
    See
    Query
    of Queries user guide
    Phil

  • Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?

    Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?
      Now a days we are saving / extracting data in a excel spreadsheet, but we would like to do that using a database because it is better.

    You can use ODBC connection to work with SQL Server database.
    Use SQLExec object to execute the SQL statement. Here is a KB about the SQL statement.
    http://digital.ni.com/public.nsf/allkb/4ADEEA04CD24AE0B862565E20002A16F?OpenDocument
    To write data to spreadsheet is more straightforward because Lookout has built-in spreadsheet object. But you need to write SQL statement by yourself to interact with other database.
    To read the data back is the same way. Just use "select" SQL statement to query. You can use Datatable object to query.
    The "Data Source" can be "DSN = data source name;". The data source name is configured in Control Panel->Administrative Tools->Data Sources(ODBC).
    Ryan Shi
    National Instruments

Maybe you are looking for