Log for all the sql statement executed

Hi,
I would like to know how to see the log for all the sql statement executed starting from connection to all the database related actions.
Is it something that i need to set it up in the driver?
I'm using Tomcat and JDBC driver.
Please reply.
Thanks,
Anjana

Make your own.
Calendar cal = new GregorianCalendar();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH) + 1;
int day = cal.get(Calendar.DAY_OF_MONTH);
//use calendar object to get other infos such as time of query
//append your query string
File f  =new File ("c:\\jakarta-tomcat-3.2.4\\webapps\\ASD\\LOGS\\log" + df.format(day) + df.format(month) + year + ".txt");
               if (! f.exists())
                    f.createNewFile();
               FileWriter fw = new FileWriter (f, true);
               // append new log to end of file
               fw.write(buf.toString());
               fw.write("\n");
               fw.flush();
               fw.close();
          catch (IOException ioe)
               System.out.println(ioe.toString());

Similar Messages

  • Find all the sql statements that are executed in a database

    Hi
    I would like to get all the sql statements that have been executed till now on the database. Also, i need the session and user details who has executed the statement.
    I know this can be done after enabling auditing.
    I would like to get the details without enabling the auditing option.
    I am using oracle 9i and oracle 10g.
    Regards,
    Vamsi

    You can use {noformat}{noformat} tags to preserve the SQL format. Below is an example of how to use it.
    <place your code here>\When your do that your code may look like this.select
         substr(sid || ',' || serial#,0,15) sid,
         USERNAME,
         PROGRAM,
         MACHINE,
         OSUSER,
         TERMINAL,
         sql_text Query
    from
         v$sqltext,
         v$session
    where
         address=sql_address
         and hash_value=sql_hash_value
         and status='ACTIVE'
    order by LOGON_TIME,sid,piece
    This one is more readable to everyone.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Look for histroy of sql statement executed in database

    is there a way to look for histroy or list of sql statement executed in database.?
    similar to history command in linux or bash shell.

    The newer <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2131.htm">v$sqlstats</a> (10g) is recommended over v$sql as (according to the documentation) it's "faster, more scalable, and has a greater data retention (the statistics may still appear in this view, even after the cursor has been aged out of the shared pool)", although it's missing a couple of the columns v$sql has.
    The history version (if you are licenced for AWR, which is part of the extra-cost Diagnostics Pack - you may not be licenced to use it even if the dictionary views are installed) is DBA_HIST_SQLSTAT.

  • Exception handling for all the insert statements in the proc

    CREATE PROCEDURE TEST (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    if @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE [MONTH] BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND [YEAR] BETWEEN year(@StartDate) and year(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1
    A,B,C
    SELECT
    A,BC
    FROM XYZ
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT>0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    END--End of Main Begin
    I have the above proc inserting data based on parameters  where in @InsertCase  is used for case wise execution.
     I have written the whole proc with exception handling using try catch block.
    I have just added one insert statement here for 1 case  now I need to add further insert  cases
    INSERT INTO TAB4
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB3
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB2
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    I will be using following to insert further insert statements 
    if @InsertCase =1 
    I just needed to know where will be my next insert statement should be fitting int his code so that i cover exception handling for all the code
    Mudassar

    Hi Erland & Mudassar, I have attempted to recreate Mudassar's original problem..here is my TABLE script;
    USE [MSDNTSQL]
    GO
    /****** Object: Table [dbo].[TAB1] Script Date: 2/5/2014 7:47:48 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[TAB1](
    [COL1] [nvarchar](1) NULL,
    [COL2] [nvarchar](1) NULL,
    [COL3] [nvarchar](1) NULL,
    [START_MONTH] [int] NULL,
    [END_MONTH] [int] NULL,
    [START_YEAR] [int] NULL,
    [END_YEAR] [int] NULL
    ) ON [PRIMARY]
    GO
    Then here is a CREATE script for the SPROC..;
    USE [MSDNTSQL]
    GO
    /****** Object: StoredProcedure [dbo].[TryCatchTransactions1] Script Date: 2/5/2014 7:51:33 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[TryCatchTransactions1] (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    IF @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE START_MONTH BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND START_YEAR BETWEEN year(@StartDate) and YEAR(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1 (COL1,COL2,COL3)
    VALUES ('Z','X','Y')
    SELECT COL1, COL2, COL3
    FROM TAB1
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT > 0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    PRINT @SUCCESSMESSAGE
    END--End of Main Begin
    GO
    I am just trying to help --danny rosales
    UML, then code

  • How to trace the SQL statements executed in a database

    I am using Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production on a sun server and I am not familiar with Oracle but with MS SQL there is a tool called profiler, it allows you to monitor and see what is going on in a specific databases whether it is SQL statement executins or anything else. I have installed the oracle enterpise manager console at my windows client and I tried to look for a tool similar to the profiler in the MS SQL. I tried the TRACE DATA VIEWER and I inputed the login credentials but I don' t actually know the service name and I am getting an error ORA-12514 The TSN listener can not resolve the service name given in the connect descriptor. Therefore, am I on the right road so i have to look for the service name or are there any other ways i can trace the currently executing SQL statement in a specific database. I am really stuck there. I would appreciate if somebody help me out. Thanks
    Abdel Moalim

    Abdel Moalim wrote:
    I am using Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production on a sun server and I am not familiar with Oracle but with MS SQL there is a tool called profiler, it allows you to monitor and see what is going on in a specific databases whether it is SQL statement executins or anything else. I have installed the oracle enterpise manager console at my windows client and I tried to look for a tool similar to the profiler in the MS SQL. I tried the TRACE DATA VIEWER and I inputed the login credentials but I don' t actually know the service name and I am getting an error ORA-12514 The TSN listener can not resolve the service name given in the connect descriptor. Therefore, am I on the right road so i have to look for the service name or are there any other ways i can trace the currently executing SQL statement in a specific database. I am really stuck there. I would appreciate if somebody help me out. Thanks
    Abdel MoalimHi
    I see others have answered the network connectivity issues, I'll try and address the tracing issue. Your best bet is to review http://www.petefinnigan.com/ramblings/how_to_set_trace.htm for the many ways in which a sessions SQL and indeed other activity can be traced. In version 7 (which I'm guessing is yours from the sid) the only profiler available was tkprof (Trace Kernel Profiler) which will do a good job of analysing your trace file. The trace files themselves are generated on the server in a protected directory so you may need to ask your dba for access to them. There are other profilers around now (I have one which runs in v9 and higher database at http://www.niall.litchfield.dial.pipex.com/SimpleProfiler/SimpleProfiler.html which will analyse your files for example) but tkprof is the start point - or else just reading the trace file in a text editor. There is also a utility written by the Oracle Apps guys trcanalyzer that will do a good job for you. In general the interface is poor compared with the ms utility but the information is deeper and more helpful
    Niall Litchfield
    http://www.orawin.info/

  • How to find all the sql executed in the database

    Hi
    We want to be able to collect all the sql statements executed in the database and be able to dump them in a file or a table. Can anyone tell me how we can get that done?
    Regards,

    if you are using oracle 10g, you can use one of the
    option of datapump tool to do thisthat's new to me, can you show us how ?
    For OP, you can check v$sqlarea view to find out all the sql statement still in shared_pool, however, there's no guarantee you will have all sql executed since database started.
    Like other poster mentioned, enable auditing if you want to collect that information.

  • OpenSQLException - The SQL statement "INSERT INTO "KMC_SUB_RCPT"...

    Hallo,
    We have the problem that subscriptions cannot be sent. In defaultTrace I have found following entry:
    #1.5 #32B150008004002400001641000710B80004539FE52B4274#1217846116565#com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionsOpenSQL#sap.com/irj#com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionsOpenSQL#LI01736#118449##iscp63.isc.aok.de_LFP_399377450#LI01736#03186780621111ddb4c432b150008004#SAPEngine_Application_Thread[impl:3]_10##0#0#Fatal##Plain###Cannot unsubscribe user. Context: ResourceContext: user=LI01736, creationTime=1217846116420, locale=de. User: LI01736. ID: 50cdd784-51ac-2810-2393-ea9709f50de3. Recipient: com.sapportals.wcm.util.channels.wcm.Recipient@ce9b7f70. Step: Executing SQL INSERT. . Trying to rollback transaction.#
    #1.5 #32B150008004002400001643000710B80004539FE52B989A#1217846116586#com.sap.sql.jdbc.common.StatementAnalyzerImpl#sap.com/irj#com.sap.sql.jdbc.common.StatementAnalyzerImpl#LI01736#118449##iscp63.isc.aok.de_LFP_399377450#LI01736#03186780621111ddb4c432b150008004#SAPEngine_Application_Thread[impl:3]_10##0#0#Error#1#/System/Database/sql/jdbc/common#Java#com.sap.sql_0019##Exception of type com.sap.sql.log.OpenSQLException caught: The SQL statement "INSERT INTO "KMC_SUB_RCPT" ("ID","RECIPIENT","RCPTTYPE","UNSUBSCRIBED") VALUES ('50cdd784-51ac-2810-2393-ea9709f50de3','LI01736','0','X')" contains the semantics error[s]: - 1:27 - the column >>ID<< is undefined in the current scope
    [EXCEPTION]
    #3#com.sap.sql.log.OpenSQLException#The SQL statement "INSERT INTO "KMC_SUB_RCPT" ("ID","RECIPIENT","RCPTTYPE","UNSUBSCRIBED") VALUES ('50cdd784-51ac-2810-2393-ea9709f50de3','LI01736','0','X')" contains the semantics error[s]: - 1:27 - the column >>ID<< is undefined in the current scope
    #com.sap.sql.log.OpenSQLException: The SQL statement "INSERT INTO "KMC_SUB_RCPT" ("ID","RECIPIENT","RCPTTYPE","UNSUBSCRIBED") VALUES ('50cdd784-51ac-2810-2393-ea9709f50de3','LI01736','0','X')" contains the semantics error[s]: - 1:27 - the column >>ID<< is undefined in the current scope
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:38)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
         at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
         at com.sap.sql.jdbc.common.CommonStatementImpl.executeUpdate(CommonStatementImpl.java:159)
         at com.sap.engine.services.dbpool.wrappers.StatementWrapper.executeUpdate(StatementWrapper.java:162)
         at com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionsOpenSQL$SqlCommand.executeUpdate(SubscriptionsOpenSQL.java:3834)
         at com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionsOpenSQL.unsubscribe(SubscriptionsOpenSQL.java:2127)
         at com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionManager.unsubscribe(SubscriptionManager.java:3226)
         at com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionManager.unsubscribe(SubscriptionManager.java:3205)
         at com.sapportals.wcm.repository.service.subscription.wcm.ActionInboxItemProducer.executeItemAction(ActionInboxItemProducer.java:222)
         at com.sapportals.wcm.service.actioninbox.wcm.ActionInboxService.executeItemAction(ActionInboxService.java:610)
         at com.sapportals.wcm.service.actioninbox.wcm.ActionInboxService.executeItemActions(ActionInboxService.java:1221)
         at com.sapportals.wcm.control.actioninbox.ActionInboxDetailsControl.onClick(ActionInboxDetailsControl.java:396)
    Any Idea?
    Regards,
    Gerhard

    Statement statement = connection.createStatement();
    //createing a statement object
    String query= "INSERT INTO table......"
    output.append("\nSending query:" + connection.nativeSQL(query));
    int result = statement.executeUpdate(query);//updates database wit record
    if (result==1)
    output.append("\ninsertation successfull");
    JOptionPane.showMessageDialog(null,"Insertation successfull ",
    JOptionPane.INFORMATION_MESSAGE);
    else
    output.append("\ninsertation unsuccessfull");
    JOptionPane.showMessageDialog(null,"Insertation unsuccessfull",
    JOptionPane.WARNING_MESSAGE);
    statement.close();
    have left out the trys and catches and some other bits and pieces that i dont think ud need its the bare bones but it might help or at least give u an idea. have used this code before to do something similar.

  • Executing the SQL statement is not allowed - Error

    I am getting "Executing the SQL statement is not allowed" for an INSERT cfquery that I'm running.  I checked the usual suspects:
    - DSN allows INSERT
    - I've seen reports online where certain field names or values are considered key words, so for protection CF blocks the query in this way (it would be nice if there was a different error message when it gets blocked this way vs. the DSN doesn't allow INSERT error message).  The field names and values were all benign strings, so it didn't seem like that.
    I took the same string for the query and ran it on another page and it ran fine (same DSN, too).

    SOLVED: I decided to enter this in here, just to get it into web searches for others since I couldn't find anything.
    - I was calling a function for one of the values in the query:  get_db_status_code("initialize")  Apparently CF parses the query to see if it's allowed BEFORE it runs the CFML in it, so something in that function name, or the parameter "initialize" was a key word that CF doesn't allow.  I moved the function call outside of the query and loaded a temp variable for use in the query and it then worked.

  • The number of reloads for the SQL statements

    Hi,
    in 10g R2, how to see the number of reloads for the SQL statements ? Any query ? Which value is high ? Which valu is low ?
    Thanks.

    thanks all.
    It was a test question for 1Z0-042 exam as follows :
    The users on your SALESDB are complaining of slow response to their queries. Using the SQL Tuning Advisor, you determine
    that the SQL statements are using the best optimization plan. Querying the dynamic views, you see that the number of reloads
    for the SQL statements is high, which can cause performance degradation.
    Which component of the SGA should you resize to reduce the number of reloads of the SQL statements?
    Answer :
    shared poolThen I wonder how to see the number of reloads for the SQL ?

  • Execute the sql statement stored in table

    friends i m in complication that, how can i execute sql statement which is stored in database table.
    how can i fetch that particular statement from table and make it execute!!!
    Thanks in advance

    I think we should stop at this point and have a little think.
    My understanding is that your plan is to do the following
    -Execute a Dynamic SQL statement which is constructed from values in several columns in a table (Bad idea to begin with)
    -The result of the execution is then loaded into PL/SQL.....not sure how you are handling different column lists but I'll assume you are not having to convert every column value to a VARCHAR2
    -The values returned are then used in an INSERT statement
    So basically your goal here is to take some data from one table and insert it into another table by moving data from SQL to PL/SQL then back to SQL in an elaborate, dynamic way. This is a costly waste of resources and will not scale (this is before we get to the problem of having to read the SQL statement from a table in the first place)
    I would recommend looking the INSERT SELECT statement here: http://psoug.org/reference/insert.html
    This will get the job done in one go. If you really do need it to be dynamic (which you don't, trust me) then you can still store this statement in your "dynamic SQL" table and execute it using EXECUTE IMMEDIATE although I can say for sure that you're going to run into more problems down the line with this architecture, it won't scale very well, and you'll probably waste at least *1* day of your time every week trying to fix a bug caused by the removal of a table, change to a column name etc.......
    However if you believe that storing SQL in a table is the best solution to your problem then go ahead.....at least when you find out that it isn't you'll have learned a valuable lesson.

  • I purchased the Brookstone DLP projector for the iPhone, and all the reviews state the iPhone 4S can be mirrored with it. However, I can't not figure out how to do so. Is there a setting to change? Can't figure it out! ARGGG!

    I purchased the Brookstone DLP projector for the iPhone, and all the reviews state the iPhone 4S can be mirrored with it. However, I can't not figure out how to do so. Is there a setting to change? Can't figure it out! ARGGG!
    It will show pictures and videos if I choose, Start Slideshow, but it won't show anything else, no apps, etc.
    Here's a few examples of the reviews which state it mirrors:
    http://www.bgr.com/2011/11/07/brookstone-pocket-projector-for-iphone-4-and-4s-re view/
    http://www.gadgetaddict.info/brookstone-pocket-projector-for-iphone-4-and-4s-rev iew/
    I bought this for video analysis presentations with an app on the phone, so this is a key feature for me.
    Any help is appreciated.
    Jim

    I also have not figured out how to mirrow either.  I ask you both, is the sound via the projector louder than the phone itself when projector is tuerned off?  No matter what I do the max vilume through the projector speakers is lower that the phone itself even with phone remaining installed in projector.  I am think of taking it back to try another one.
    Keith

  • Method which is return's all the refinement state for Dimension.

    Hi All,
    Is there any java method which is return's all the refinement state for Dimension.
    Ex:
    Brand
    Reebok
    Scholl
    Sebago
    Ravel
    When i clicked All Brand from front end it will select all 4 Brands data.
    Any help will be great appreciation
    Thanks,
    Sunil N

    Not sure what you want to achieve here. If you want to select all the dimension values, then provided the dimension is Multi-select OR you can have N=Id-1+Id-2+Id-3 and it will return all of them. What I'm not sure on is why you would do this, you'll get back precisely the same results (provided every record is tagged with a brand) as if you did nothing, although I guess you might want to allow them to select all then deselect one or more afterwards ... Note you can also use N=<dimension-id>, where <dimension-id> is the id of the actual dimension, and that will return all records that have a value for that dimension, but that won't give you any descriptors (breadcrumbs) other than the dimension name/id.
    Michael

  • Toplink generate the SQL statement correctly but it does not return any row

    Hi
    I faced an strange problem when using Toplink as JPA provider. Following snippet shows how I create and execute a query using Toplink JPA:
    q = em.createQuery("SELECT B FROM Branch B WHERE B.street LIKE :street");
    q.setParameter("street", "'%a%'");
       List<Branch> l = q.getResultList();
      System.out.println("List Size: " + l.size());The SQL statement resulted by this query is as follow (according to the generated log file)
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST (? AS VARCHAR(32672) ))
      bind => [%a%]Problem is that List size is always 0, independent of what I provide as parameter. I tried and executed the generated SQL statement in the SQL manager and I got some tens of record as the result. The SQL statement i tested in the SQL manager is like:
    SELECT ID, STREET FROM BRANCH WHERE (STREET LIKE CAST ('%a%' AS VARCHAR(32672) ))Can someone please let me know what I am missing and how I can fix this problem?
    Thanks.

    Hi,
    Thank you for reply.
    All data are stored in lower case so, the case sensitivity is not a problem. I am wondering how the generated query works fine when I execute it in the sql manager but it return no result when it is executed by the JPA.
    Thanks for looking into my problem.

  • Tracking SQL statements executed

    Hi,
    After obtaining a connection to my Oracle 10g database using JDBC, I would like to know if there is a way to track all SQL statements executed since the connection was made.
    This must be pretty easy, I'm just stumped.
    Thank you
    Tom

    Hi, and it's not that easy. The driver certainly doesn't
    keep track of what's been done, but look at the documentation
    regarding the logging the driver can be configured to do. It can
    print out everything it does, so some level of detail and degree,
    and that can be collected in a file and examined externally.
    That can be voluminous too... It might be more (or just as)
    practical to examine the DBMS-side session-auditing/logging
    features the DBMS may have to collect everything the session
    has done.
    HTH,
    Joe Weinstein at BEA Systems

  • The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]:

    Hello all together,
    actually I try to implement an user interface for using BRTools from a J2EE Application.
    I created a datasource-alias "BRTOOLS" using netweaver administrator.
    inside the implementation i execute the following code:
    DataSource ds = (DataSource) ctx.lookup("jdbc/BRTOOLS");
    Connection con = ds.getConnection();
    String query = "select * from SDBAH;";
    Statement stmt = con.createStatement();
    try {
       ResultSet rs = stmt.executeQuery(query);
    As the result I get the following message:
    The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist.
    Using SQLplus or dbconsole I can see and use the table SDBAH. The table scheme is "SAPSR3DB"which is the standard scheme for J2EE.
    If I try:
    select * from SAPSR3DB.SDBAH;
    I get the same result.
    What is wrong in my constellation?
    Thank you very much in advance.
    Greetings Stephan

    Dear Yordan,
    yes I did a restart of the whole system.
    If I do a wrong lookup:
    e.g:
    DataSource ds = (DataSource) ctx.lookup("jdbc/BRToolsFailure");
    where Alias  "BRToolsFailure" does not exist, I get
    Object not found in lookup of BRToolsFailure.
    So I think that the Alias of the default data source is right and visible.
    Next try:
    I use an already existing alias "ADS" in my code and get the same message:
    The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist.
    If I extend the tablename with the scheme-name "SAPSR3DB" I get the following:
    The SQL statement "SELECT * FROM "SAPSR3DB"."SDBAH"" contains the semantics error[s]: - 1:24 - the table or view >>SDBAH<< does not exist
    When I use SQLPLUS SAPSR3DB/password and call:
    select * from SDBAH;
    I get a result like expected.
    Thanks a lot,
    Stephan

Maybe you are looking for

  • Lookup in another list when filtering in a view

    Hello, I need help with a public view for a list. This is my filter now: <View Name="{F9165834-6860-4EB5-A7FE-D96CE334DF70}" Type="HTML" DisplayName="My group - not assigned" Url="/sites/RomaniaL1SD/Lists/Opened tickets/My group not assigned.aspx" Le

  • Help!! My Macbook crashed and I can remember my time capsule password.

    I have a 2007 macbook. Today when I went to use not it was turned off. When turned on it loaded a language page. After selecting English it loaded Mac OS X utilities that gives 4 options: restore from time capsule, Reinstall Mac OS X, get help online

  • Clearing Rules for Defferals

    We have requirement where if the deferral date is populated in the document  or item then any incoming payment should not clear that item or document in cases where deferral date is in future, Any item with no deferral date should clear, any excess p

  • Blackberry Logo on Facebook

    When I post on Facebook, The Blackberry logo appears to the left of the timestamp on my post. Is this by default? I have seen posts that just say "via Blackberry". I was wondering if there is a setting to not show the BB logo. I downloaded the Facebo

  • Sending object between client server with some class without serializable

    Hi friend, I need to send the object from server to client via ObjectInputStream and ObjectOutputStream, however, in these objects, some are implements by others, no source code provided, which haven't implement serizlizable, so does anyone can tell