How do I run SQL statements with my GUI ?

Hello,
i created a simple GUI with a status text box on top and a text box on the bottom to type in sql commands. Can somebody help me modify my code so that I can at least run a create table command and give the status of "successful create table" in the top text box?
One other question I have is that I already have a login screen gui that creates the sql connection and that gui calls this gui. Do I have to pass this connection to this new class or not? and if so, how do i do it? thanks again!
import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
import javax.swing.*;
import java.sql.*;
public class SqlGui extends JFrame {
        public SqlGui() {
                super("Oracle SQL Application");
                setDefaultCloseOperation(EXIT_ON_CLOSE);
                JTextArea outputArea = new JTextArea("output here",20, 0);
                outputArea.setLineWrap(true);
                JScrollPane scrollOutputArea = new JScrollPane(outputArea);
                JTextArea inputArea =
                        new JTextArea("enter commands here",2, 20);
                inputArea.setLineWrap(true);
                JScrollPane scrollInputArea = new JScrollPane(inputArea);
                JPanel buttonPanel = new JPanel();
                JButton executeButton = new JButton("Execute Command");
                buttonPanel.add(executeButton);
                // do work here?
                JButton exitButton = new JButton("Exit");
                exitButton.addActionListener(new ActionListener() {
                                                     public void actionPerformed(
                                                             ActionEvent ae) {
                                                             dispose();
                buttonPanel.add(exitButton);
                JPanel sqlPanel = new JPanel(new BorderLayout());
                sqlPanel.add(scrollInputArea);
                sqlPanel.add(buttonPanel, BorderLayout.SOUTH);
                JSplitPane mainsplit =
                        new JSplitPane(JSplitPane.VERTICAL_SPLIT,
                        scrollOutputArea, sqlPanel);
                getContentPane().add(mainsplit);
                setSize(800, 500);
                setLocationRelativeTo(null);
                setVisible(true);
}

Hello,
There are two ways to execute the SQL command in GUI , one by passing the connection object from other scree as specified by you is logic screen (write a constructor which takes connection parameter as input) else create the connection in this present GUI screen also as shown by me.
import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
import javax.swing.*;
import java.sql.*;
public class SqlGui extends JFrame implements ActionListener{
     String url; // url providing the database details
     Connection connect;
     JTextArea inputArea;
     JButton executeButton;
     JTextArea outputArea;
     public SqlGui() {
          super("Oracle SQL Application");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          try
                    url = "jdbc:odbc:dsnName";
                    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                              // url , userid, pwd of database like scott,tiger
                    connect = DriverManager.getConnection(url,"userid",
                                                                           "password");
                    System.out.println("Connection Sucessful \n") ;
               catch (ClassNotFoundException cnfex)
                    cnfex.printStackTrace();
                    System.out.println("Connection Failed " + cnfex.toString());
               catch (SQLException exp)
                    System.out.println(exp);
          outputArea = new JTextArea("output here",20, 0);
          outputArea.setLineWrap(true);
          JScrollPane scrollOutputArea = new JScrollPane(outputArea);
          inputArea = new JTextArea("enter commands here",2, 20);
          inputArea.setLineWrap(true);
          JScrollPane scrollInputArea = new JScrollPane(inputArea);
          JPanel buttonPanel = new JPanel();
          executeButton = new JButton("Execute Command");
          executeButton.addActionListener(this);
          buttonPanel.add(executeButton); // do work here?
          JButton exitButton = new JButton("Exit");
          exitButton.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent ae) {
                    dispose();
          buttonPanel.add(exitButton);
          JPanel sqlPanel = new JPanel(new BorderLayout());
          sqlPanel.add(scrollInputArea);
          sqlPanel.add(buttonPanel, BorderLayout.SOUTH);
          JSplitPane mainsplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollOutputArea, sqlPanel); getContentPane().add(mainsplit);
          setSize(800, 500);
          setLocationRelativeTo(null);
          setVisible(true);
     public void actionPerformed(ActionEvent ae)     {
               if (ae.getSource() == executeButton) {
                                             // To clear the fields
                    create(inputArea.getText());
     public static void main(String args[]) {
     SqlGui app = new SqlGui();
     public void create(String SQLCommand) {
               String query = SQLCommand;
               outputArea.setText("The Result of Executing the query" + query );
               try{
               Statement st = connect.createStatement();
               st.executeQuery(query);
               JOptionPane.showMessageDialog(null,"Command Executed Sucessfully");
               catch (SQLException sqlex) {
                    System.err.println("Unable to Execute Command :");
                    outputArea.setText("Unable to Execute Command :" +query);
                    sqlex.printStackTrace();
Hope this sucessfully works for you.

Similar Messages

  • How to convert a sql statement with variable

    hello , please how can i convert the below with cast
    I need to be able to generate an explain plan, I believe I have to use cast.
    SELECT TO_NUMBER (OIL.UNIQUE_ID) REBALANCE_ORDER_ID,
    OIL.ORDER_QTY,
    OIL.ORDER_TYPE,
    OIL.ORDER_SIDE,
    OIL.POSITION_TYPE,
    OIL.AVAILABLE_QTY AVAILABLE_QUANTITY,
    OIL.ORDER_AMT GROSS_AMOUNT,
    OIL.NET_AMOUNT NET_AMOUNT,
    OIL.FEE_AMT FEE_AMOUNT,
    OIL.ACCRUED_INTEREST_AMT ACCRUED_INTEREST
    FROM TABLE (:B6) OIL

    >
    I need to be able to generate an explain plan, I believe I have to use cast.
    SELECT TO_NUMBER (OIL.UNIQUE_ID) REBALANCE_ORDER_ID,
    OIL.ORDER_QTY,
    OIL.ORDER_TYPE,
    OIL.ORDER_SIDE,
    OIL.POSITION_TYPE,
    OIL.AVAILABLE_QTY AVAILABLE_QUANTITY,
    OIL.ORDER_AMT GROSS_AMOUNT,
    OIL.NET_AMOUNT NET_AMOUNT,
    OIL.FEE_AMT FEE_AMOUNT,
    OIL.ACCRUED_INTEREST_AMT ACCRUED_INTEREST
    FROM TABLE (:B6) OIL
    >
    You are correct - cast the bind as the proper type. I have a SQL type named emp_table_type so this works
    explain plan for select * from table(cast (:e1 as emp_table_type))The types involved are
    CREATE OR REPLACE TYPE SCOTT.emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
    CREATE OR REPLACE TYPE SCOTT.emp_table_type as table of emp_scalar_type
    /

  • How to Run SQL Tuning Advisor on the SQL statement with SQL_ID?

    Can you give the steps to run the SQL tuning advisor on the SQL statement with SQL_ID?
    Database version: 10g Release 2

    Hi,
    You can use either the automatic SQL tuning features that are accessible from Enterprise Manager Database Console on the "Advisor Central" page or trough SQL*PLUS using the DBMS_SQLTUNE pakage:
    -- creating the tuning task
    set serveroutput on
    declare
      l_sql_tune_task_id  varchar2(100);
    begin
      l_sql_tune_task_id := dbms_sqltune.create_tuning_task (
                              sql_id      => '<your_sql_id>',
                              scope       => dbms_sqltune.scope_comprehensive,
                              time_limit  => 60,
                              task_name   => '<your_tuning_task_name>',
                              description => 'tuning task for statement your_sql_id.');
      dbms_output.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
    end;
    -- executing the tuning task
    exec dbms_sqltune.execute_tuning_task(task_name => '<your_tuning_task_name>');
    -- displaying the recommendations
    set long 100000;
    set longchunksize 1000
    set pagesize 10000
    set linesize 100
    select dbms_sqltune.report_tuning_task('<your_tuning_task_name>') as recommendations from dual;For more information, take a look at link provided by Jaffy.
    Cheers
    Legatti

  • How do I use SQL statements to perform calculations with form fields????

    Please help!!! I don't know how to use a SQL statement within my APEX form......
    My form is below. The user will enter the values in the form. Click on Submit. Then we need to run a SQL select statement with those values.
    Our form looks like this:
    Start_Date ____________
    Per_Period ____________
    Period ____________
    [Submit Button]
    The user will enter these 3 values in the form.
    This is an example of an user providing the values:
    Start_Date 03/14/08_______
    Per_Period $200.00________
    Period 4____________
    [Submit Button]
    Then they will click the Submit Button.
    The SQL statement (BELOW) returns output based on the users selections:
    START_DATE PER_PERIOD PERIOD
    14-MAR-2008 00:00 200 Week 1 of 4
    21-MAR-2008 00:00 200 Week 2 of 4
    28-MAR-2008 00:00 200 Week 3 of 4
    04-APR-2008 00:00 200 Week 4 of 4
    Total 800
    This is the full text of the SQL that makes the output above:
    with criteria as (select to_date('03/14/08', 'mm/dd/rr') as start_date,
    4 as periods,
    'Week' as period,
    200 per_period from dual),
    periods as (select 'Week' period, 7 days, 0 months from dual
    union all select 'BiWeek', 14, 0 from dual
    union all select 'Month', 0, 1 from dual
    union all select 'ByMonth', 0, 2 from dual
    union all select 'Quarter', 0, 3 from dual
    union all select 'Year', 0 , 12 from dual
    t1 as (
    select add_months(start_date,months*(level-1))+days*(level-1) start_date,
    per_period,
    c.period||' '||level||' of '||c.periods period
    from criteria c join periods p on c.period = p.period
    connect by level <= periods)
    select case grouping(start_date)
    when 1 then 'Total'
    else to_char(start_date)
    end start_date,
    sum(per_period) per_period,
    period
    from t1
    group by rollup ((start_date, period))
    THANKS VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    You're just doing a parameterized report, where the input fields are your parameters.
    Check out the Advanced Tutorial titled Parameterized Report here:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/rprt_query.htm#BGBEEBJA
    Good luck,
    Stew

  • How to find sql statement with Unix process pid

    Hi
    how to find sql statement with Unix process pid
    is there any view to find that.
    please if so let me know
    Thanks in advance

    this is how I am doing this:
    oracle 7352340 7459066 0 07:47:10 - 0:00 oracleJDERED (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    oracle 7459066 5386396 2 07:47:10 pts/1 0:01 sqlplus
    select sid,serial# from v$session where process='7459066';
    SID SERIAL#
    2178 6067
    select sql_text
    from
    v$sqlarea a,
    v$session b
    where a.hash_value = b.sql_hash_value
    and b.sid = 2178
    ;

  • Pl/sql statement with output in reports

    Hello,
    I am quite new to reports and pl/sql, i have built a pl/sql statement with some loops that works fine when running it in sqlplus.
    I would really like to have this running in reports with the variables (v_year, v_month and v_sumvalue) in a table/record in the data view, so i can use them just like any ordinary fields in a table for example in a diagram.
    I have tried to create a package spec, setting up a record with the variables as fields. And then a pl/sql function with the following sql (which was a bit modified to work in the pl/sql function). Everything seemed to work since the pl/sql table/record was there with the variables as fields in it, but it never returned anything... just fatal error.
    Here is the original pl/sql statement which is working in sqlplus, any help/directions in how to get this working so i can use the variables like fileds in a regular table would be fantastic:
    DECLARE
       v_year number(4);
       v_month number(2);
       v_sumvalue number(9,3);
       v_sta varchar2(10);
       v_end varchar2(10);
       v_stopmonth number(2);
    BEGIN
       --## Get last 5 years ##--
       select
          to_char(add_months(sysdate,-60),'YYYY'),
          to_char(sysdate,'MM')
          into v_year, v_stopmonth
       from
          dual;
       --dbms_output.put_line(v_year);
       --## Loop 5 years ##--
       for i in 1..5 loop
          v_year := v_year + 1;
          --dbms_output.put_line(v_year);
          --## Loop 12 times (months) ##--
          for k in 0..11 loop
             v_month := k +1;
             --dbms_output.put_line(v_year ||'-'|| v_month);
             select
                sum(nvl(p.value,0)) / 3,
                last_day(add_months(to_date(v_year ||'-'|| v_month ||'-01','YYYY-MM-DD'),-3))+1,
                last_day(to_date(v_year ||'-'|| v_month ||'-01','YYYY-MM-DD'))
                into v_sumvalue, v_sta, v_end
             from
                project p
             where
                p.country_code = 'SWE'
             and
                p.project_type_code = 'P'
             and
                p.start_date between last_day(add_months(to_date(v_year ||'-'|| v_month ||'-01','YYYY-MM-DD'),-3))+1 and last_day(to_date(v_year ||'-'|| v_month ||'-01','YYYY-MM-DD'))
             and
                p.q_category_code between 1000 and 1299
             and
                p.geography_code between 2100 and 2199;
             dbms_output.put_line(v_year ||'-'|| v_month ||' '|| v_sumvalue);
             --dbms_output.put_line(v_year ||'-'|| v_month ||' '|| v_sumvalue ||' '|| v_sta ||' '|| v_end);
          --## Stop monthloop ##--
          end loop;
       --## Stop yearloop ##-
       end loop;
    END;Output:
    2003-1 19.1
    2003-2 20.1
    2007-11 164.5
    2007-12 135.167Best regards,
    Olle

    Hi,
    Maybe pipelined functions will be useful for you:
    http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/x/Table_Functions_Cursor_Expressions/Pipelined_Table_Functions.htm
    Regards
    Jakub Flejmer

  • Where to run SQL statements in Oracle Database 11gR1 ?

    Folks,
    Hello. I have just installed Oracle Database 11gR1 and login to Database Control page. There are 4 tabs on the top: Database, Setup, Preference, Help and Logout.
    I just create a table "table1" in "Database" tap. But I don't see anywhere to run SQL statement such as Select, Insert, Update.
    Can any folk tell me where to run SQL statements in Oracle Database 11gR1 ?
    Or
    Can any folk provide a User Manual for Oracle DB 11gR1 ?

    You can run from a terminal or install an SQL client and connect from there.
    http://www.articlesbase.com/databases-articles/how-to-install-oracle-11g-client-1793770.html
    Best Regards
    mseberg
    Assuming you have an oracle OS user on Linux you can try typing sqlplus at you OS command prompt. Generally you will have a .bash_profile with setting like this:
    # User specific environment and startup programs
    PATH=$PATH:$HOME/bin
    export PATH
    # Oracle Settings
    TMP=/tmp; export TMP
    TMPDIR=$TMP; export TMPDIR
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0
    #export DISPLAY=localhost:0.0
    export TZ=CST6CDT 
    export ORACLE_SID=ORCL
    export ORACLE_TERM=xterm
    #export TNS_ADMIN= Set if sqlnet.ora, tnsnames.ora, etc. are not in $ORACLE_HOME/network/admin
    export NLS_LANG=AMERICAN;
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    export LD_LIBRARY_PATH
    # Set shell search paths
    PATH=/usr/sbin:$PATH; export PATH
    export PATH=$PATH:$ORACLE_HOME/bin
    # CLASSPATH:
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
    export EDITOR=vi
    set -o vi
    PS1='$PWD:$ORACLE_SID >'Edited by: mseberg on Jul 11, 2011 3:18 PM

  • Current running sql statement in procedure?

    How to identify the current running sql statement in procedure or package? From the v$sqlarea, i can see the only procedure name with parameters, but not current execution statement? is there any dba view to know the current execution statement in 9i & 10g ?

    hi
    u can also use dba_source view to know which sql statement issued by which user

  • Run SQL statements from a textbox

    Hi
    I'm trying to execute multiple insert/update or Delete statements from a textarea of a page. I'm basically trying to replicate the same functionalility as SQL Workshop for users to access and run sql statements for it.
    I know in SQL workshop you can run multiple insert/update or delete statements using the following syntax:
    begin
    insert into table_1 (col1,col2)values('WER','QWE');
    Insert into table_1 (col1,col2)values('ABC','DEF');
    End;
    I have created a textarea called :P1_SQL with a submit button which when pressed it runs the execute immediate :P1_SQL. It works if its a single insert command. I've tried the begin...end option which bring up the following error message:
    ORA-06550: line 1, column 6: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "begin was inserted before "" to
    Any ideas how I could get this to work?
    Message was edited by:
    Funkymonkey2

    The process code that I have is as follows:
    Declare
    l_sql varchar2 (4000);
    begin
    l_sql := :P3_SQL;
    execute immediate l_sql;
    End;
    in the textarea I had entered the following
    begin
    insert into TBL_TEST_SQL(name,useR_id)values('abc','erf' );
    insert into TBL_TEST_SQL(name,useR_id)values('dec','erf');
    end;
    I was actually hoping to concatanate the 'begin...' part and the 'end;/' part on to the beginning and end of the sql statements.
    Any ideas??

  • How to set Query SQL Statement parameter dynamically in Sender JDBCAdpter

    Hi All,
    I have one scenario in which we are using JDBC Sender Adapter.
    Now in this case,we need to set Query SQL Statement with a SELECT statement based on some fields.
    This SQL statement is not constant, it would need to be changed.
    Means sometimes receiver will want to execute SQL statement with these fields and sometimes they will want to execute it with different fields.
    We can create separate channels for each SQL statement but again that is not an optimum solution.
    So ,I am looking out for a way to set these parameters dynamically or set SQL statement at Runtime.
    Can you all please help me to get this?

    Shweta ,
    <i>Sometimes receiver will want to execute SQL statement dynamically</i>....
    How you will get the query dynamically? Ok Let me assume, consider they are sending the query through file, then its definitely possible. But u need BPM and also not sender JDBC receiver adapter instead, receiver JDBC adapter.
    SQL Query File ->BPM>Synchronous send [Fetch data from DB]--->Response -
    >...............
    Do u think the above design will suit's ur case!!!!
    Best regards,
    raj.

  • How to dynamically create sql statement for Defaulting Segment Values?

    Hi,
    Navigation:
    1) Descriptive/Segments
    2) Query for DFF to be modified
    3) Uncheck “Freeze Flexfield Definition”
    4) (B) Segments
    5) Segments Summary form opens
    6) (B) open - Segments form opens
    Now, here I want to specify Default type as "SQL Statement" and in the default value field I want to use SQL statement with parameters (to evaluate the default value).
    The parameters should be pass at runtime from the form in which we have this DFF. The parameters value should be one of the values which get evaluated at runtime in the form window.
    Please suggest how we can achieve this?
    Or is there any alternative to achieve this?
    Thanks!!
    Regards,
    Narender
    Edited by: Narender Singh on Mar 30, 2010 7:47 AM
    Edited by: Narender Singh on Mar 30, 2010 7:48 AM

    Jason,
    it is possible, though not so simple as with a report.
    What you need to do is to create a pipelined function, that returns your date and count data. This pipelined function can be the base of a pseudo-table, which can be used in a select. For the pipelined function you need to define types for one row and a table to define the return-type for your function:
    create or replace type calendar_row as object (date_time date, description varchar2(250));
    create type calendar_table as table of calendar_row;
    Then you can create the package with the function:
    ================================================
    create or replace package dyn_calendar is
    procedure set_query(i_query in varchar2);
    function view_source return calendar_table pipelined;
    end;
    create or replace package body dyn_calendar is
    v_query varchar2(100) := null;
    procedure set_query(i_query in varchar2) is
    begin
    v_query := i_query;
    end;
    function view_source return calendar_table pipelined is
    TYPE cursor IS REF CURSOR;
    c_cal cursor;
    v_date_time date := null;
    v_description varchar2(100) := null;
    r_cal calendar_row;
    begin
    open c_cal for v_query;
    fetch c_cal into v_date_time, v_description;
    loop
    exit when c_cal%notfound;
    r_cal := calendar_row(v_date_time, v_description);
    pipe row(r_cal);
    fetch c_cal into v_date_time, v_description;
    end loop;
    return;
    end;
    end;
    ================================================
    Now you can set query in a PL/SL region before the calendar:
    dyn_calendar.set_query(SELECT count(*), ' || :P8_SOURCE_DATE || ' FROM ' || :P8_SOURCE_TABLE || ' GROUP BY ' || :P8_SOURCE_DATE);
    and you can base your calendar on the query:
    select * from table(dyn_calendar(view_source))
    Good luck,
    Dik

  • RMAN-10006: error running SQL statement: alter session set remote_dependenc

    Backups are failing with following error
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-12001: could not open channel default
    RMAN-10008: could not create channel context
    RMAN-10002: ORACLE error: ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must be from among MANUAL, AUTO
    RMAN-10006: error running SQL statement: alter session set remote_dependencies_mode = signature
    Not able to change to signature
    SQL> alter session set remote_dependencies_mode=signature;
    ERROR:
    ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must
    be from among MANUAL, AUTO
    I dont see MANUAL or AUTO as valid value for this parameter (http://download.oracle.com/docs/cd/B10501_01/server.920/a96536/ch1175.htm#1023124) DB version is 9.2.0
    Parameter type
    String
    Syntax
    REMOTE_DEPENDENCIES_MODE = {TIMESTAMP | SIGNATURE}
    Default value
    TIMESTAMP
    Parameter class
    Dynamic: ALTER SESSION, ALTER SYSTEM
    =======================================
    I believe it could be because of following bug
    "A PRE-PATCHED ORACLE IMAGE CAN BE INSTALLED IN MEMORY "
    Refer: "https://metalink2.oracle.com/metalink/plsql/f?p=130:15:1613505143885559758::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,4610411,1,1,1,helvetica"
    I appreciate your effort in fixing this issue.
    Edited by: user10610722 on Nov 25, 2008 4:37 PM

    Hi:
    It seems when you are starting RMAN it's executing some commands (one 'ALTER SESSION...'. It's seems to be a batch which has a bad value for SORT_AREA_SIZE. Find it and modify to a proper value as message shows. If you can't find start RMAN by calling directly the executable ($ORACLE_HOME/bin/rman or %ORACLE_HOME%/bin/rman.exe).

  • Dynamic SQL Statement with table name

    Dear all
    i like to have a SQL statement with a dynamic tablename. Is this possible? If yes, how?
    should be something like "select * from <mytablename>"
    Thank you
    Herbert

    Yes this is possible. use the below reference code for this.
    data: g_tablename type w_tabname,
            gv_dref TYPE REF TO data.
    FIELD-SYMBOLS: <g_itab> TYPE STANDARD TABLE.
    gv_tabname = p_tablename (take table name form selection screen or as per ur requirement)
    CREATE DATA gv_dref TYPE TABLE OF (g_tabname).
    ASSIGN gv_dref->* TO <g_itab>.
    now use the below select query to fetch the data
      SELECT * FROM (gv_tabname) INTO TABLE <g_itab>.
    Hope this will help

  • SQL-Statement with OO4O

    Hello together,
    I post this Question here in
    Re: SQL-Statement with OO4O
    and i should paste my question again in an another database forum.
    now here again:
    I have here following Problem:
    Everthime I make a connection to my database with this code
    Set oSess = Server.CreateObject("OracleInProcServer.XOraSession")
    Set oDB = oSess.DbOpenDatabase(tnsname, user/PWD, 4)
    I get always this Statement in the DB-queue
    SELECT parameter, VALUE
    FROM SYS.nls_database_parameters
    WHERE parameter IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET')
    Can me anyone tell me why I get this statement and how I can disable it?
    Best Regards
    Andy

    Hi,
    What can you do/change?I must ask next week my boss when he is back,
    what kind of changes I can do.
    Can you add a PL/SQL call to DBMS_APPLICATION_INFO into application?my boss must give me the permission to do a call to DBMS_APPLICATION_INFO.
    A way to identify the source of the badly behaving code is required; whether that be within the DB or external of it.I think so too.
    So please wait, until I have talk with my boss, than I will give you the answer you want. Sorry.
    Any other ideas, what I can do without call/changes on the database to find the problem?
    Best Regards
    Andy

  • Display the sql statement with arguments with ojdbc14_g.jar

    Hi,
    I'd like to display the sql statements with ojdbc14_g.jar.
    So I've followed the documentation and set an OracleLog.properties file which is linked to my java program.
    The problem is the trace generated is huge and I only need the SQL requests wich are made with the arguments but I don't know how to configure that.
    Have you got a sample file which handle that ?
    I've tried that :
    oracle.jdbc.handlers=java.util.logging.ConsoleHandler
    java.util.logging.ConsoleHandler.level=CONFIG
    java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
    oracle.level=INFO
    oracle.jdbc.driver.level=OFF
    oracle.jdbc.driver.OraclePreparedStatement.level=OFF
    oracle.jdbc.pool.level=OFF
    oracle.jdbc.util.level=OFF
    oracle.sql.level=INFO
    But that doesn't display only the SQL and args :(
    Regards.

    The fact is the statement are made by ejb entities on JBoss so I don't have a way to make specific logger to display the sql order. The only thing I can do is to set the log4j org.jboss.ejb.plugins.cmp to a trace level in order to see the sql order but without the arguments.
    I tried those traces however I see stuff like that without any SQL orders :
    <<
    10:10:53,833 INFO [STDOUT] NFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:52 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:52 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:52 oracle.jdbc.driver.PhysicalConnection getDefaultFixedString
    INFO: PhysicalConnection.getDefaultFixedString() returning false
    29 nov. 2007 10:10:52 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=1, x=%)
    29 nov. 2007 10:10:52 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=2, x=VIEW_ACTION_NAMES)
    29 nov. 2007 10:10:52 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:52 oracle.jdbc.driver.T4CPreparedStatement allocateTmpByteArray
    GRAVE: oracle.jdbc.driver.T4CPreparedStatement.allocateTmpByteArray : Re-allocate byte array of size : 4000
    29 nov. 2007 10:10:52 oracle.jdbc.driver.OracleResultSetImpl close
    INFO: OracleResultSetImpl.close()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getMetaData
    INFO: PhysicalConnection.getMetaData()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getCatalog
    INFO: PhysicalConnection.getCatalog()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getDefaultFixedString
    INFO: PhysicalConnection.getDefaultFixedString() returning false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=1, x=%)
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=2, x=PROCESS_TYPE_HIERARCHY)
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.T4CPreparedStatement allocateTmpByteArray
    GRAVE: oracle.jdbc.driver.T4CPreparedStatement.allocateTmpByteArray : Re-allocate byte array of size : 4000
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OracleResultSetImpl close
    INFO: OracleResultSetImpl.close()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getMetaData
    INFO: PhysicalConnection.getMetaData()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getMetaData
    INFO: PhysicalConnection.getMetaData()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getCatalog
    INFO: PhysicalConnection.getCatalog()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getDefaultFixedString
    INFO: PhysicalConnection.getDefaultFixedString() returning false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=1, x=%)
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=2, x=PROCESS_TYPE_HIERARCHY)
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.T4CPreparedStatement allocateTmpByteArray
    GRAVE: oracle.jdbc.driver.T4CPreparedStatement.allocateTmpByteArray : Re-allocate byte array of size : 4000
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OracleResultSetImpl close
    INFO: OracleResultSetImpl.close()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getMetaData
    INFO: PhysicalConnection.getMetaData()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getCatalog
    INFO: PhysicalConnection.getCatalog()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getDefaultFixedString
    INFO: PhysicalConnection.getDefaultFixedString() returning false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=1, x=%)
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=2, x=FORM_EMBEDDED_VIEWS)
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.T4CPreparedStatement allocateTmpByteArray
    GRAVE: oracle.jdbc.driver.T4CPreparedStatement.allocateTmpByteArray : Re-allocate byte array of size : 4000
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OracleResultSetImpl close
    INFO: OracleResultSetImpl.close()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getMetaData
    INFO: PhysicalConnection.getMetaData()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getMetaData
    INFO: PhysicalConnection.getMetaData()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getCatalog
    INFO: PhysicalConnection.getCatalog()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRemarksReporting
    INFO: PhysicalConnection.getRemarksReporting()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getDefaultFixedString
    INFO: PhysicalConnection.getDefaultFixedString() returning false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=1, x=%)
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OraclePreparedStatement setString
    INFO: OraclePreparedStatement.setString(paramIndex=2, x=FORM_EMBEDDED_VIEWS)
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getRestrictGetTables
    INFO: PhysicalConnection.getRestrictGetTables() returned false
    29 nov. 2007 10:10:53 oracle.jdbc.driver.T4CPreparedStatement allocateTmpByteArray
    GRAVE: oracle.jdbc.driver.T4CPreparedStatement.allocateTmpByteArray : Re-allocate byte array of size : 4000
    29 nov. 2007 10:10:53 oracle.jdbc.driver.OracleResultSetImpl close
    INFO: OracleResultSetImpl.close()
    29 nov. 2007 10:10:53 oracle.jdbc.driver.PhysicalConnection getMetaData
    INFO: PhysicalConnection.getMetaData()
    29 nov. 20>>

Maybe you are looking for

  • Where can i get an a/c adapter?

    I bought an airport extreme from a guy but it didnt include the a/c adapter. Where can I get one? Thanx

  • JDBC-ODBC connectivity problem

    hi ,i have a j2se 1.4.2 version installed on windows 2000 professional.i have j2me wireless toolkit 2.0,Oracle 8i(8.1.5),tomcat 4.0 running on system.I have tried to connect to the database in Oracle through JDBC-ODBC bridge but it becomes non-respon

  • How to copy video to cd writer

    my version is 3.6 12. Need to know how I can copy, save, or otherwise save video's to my computers cd writer

  • Photo streaming iphoto or Aperture

    Is photo streaming to iPhoto faster than to Aperture 3.0 from the iPhone 4s?

  • I am unable to boot my iMac

    I was doing routine maintenance on my iMac and noticed the addition of a new user "wheel" which I deleted. I also saw the group "everybody" had been given read and write access. I changed that to read only. Now, however, when I attempt to boot up I a