Adding column name into tables.

Hi guys,
i have a panel which consist of a scroll table which i am not sure how to i add column names tru this type of coding. and some more i have to retrieve info from the database and display into this table. can someone pls guide me how to i add in the column names and how do i retrieve info out from db and displying it onto the table? a million thanks! :)
      * This method initializes jScrollPane_viewLogTable     
      * @return javax.swing.JScrollPane     
     private JScrollPane getJScrollPane_viewLogTable() {
          if (jScrollPane_viewLogTable == null) {
               jScrollPane_viewLogTable = new JScrollPane();
               jScrollPane_viewLogTable.setBounds(new java.awt.Rectangle(27,30,460, 200));
               jScrollPane_viewLogTable.setViewportView(getJTable_viewLogTable());
          return jScrollPane_viewLogTable;
      * This method initializes jTable_viewLogTable     
      * @return javax.swing.JTable     
     private JTable getJTable_viewLogTable() {
          if (jTable_viewLogTable == null) {
               jTable_viewLogTable = new JTable();
          return jTable_viewLogTable;
     }Titus

It's not my code, it's just Java.
C'mon, read the javadocs.
Or look at this:
http://www.exampledepot.com/egs/java.sql/GetRsColCount.html
%

Similar Messages

  • How to rename column name of table?

    Hello...
    How to rename column name of table?
    The column have data.
    Thanks.
    Martonio.

    The following should work in 9i release 2 and above.
    SQL> create table mytable(col1 varchar2(2),
      2  col2 date);
    Table created.
    SQL> insert into mytable values('t1',sysdate);
    1 row created.
    SQL> select * from mytable;
    CO COL2
    t1 30-NOV-04
    1 row selected.
    SQL> desc mytable
    Name                                      Null?    Type
    COL1                                               VARCHAR2(2)
    COL2                                               DATE
    SQL> alter table mytable rename column col2 to mydate;
    Table altered.
    SQL> desc mytable
    Name                                      Null?    Type
    COL1                                               VARCHAR2(2)
    MYDATE                                             DATE
    SQL> select * from mytable;
    CO MYDATE
    t1 30-NOV-04
    1 row selected.
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.3.0 - Productionhttp://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/wnsql.htm#972698

  • WRAP JTable Column Name into 2 lines

    I have a JTable with a long column Name. Can I wrap the Column Name into multiple (2) lines.

    baskaraninfo wrote:> set the following to a table column,<html><body>Employee<br>Name</body></html>>The break tag got lost cos you didnt use the code tags
    <html><body>Employee<br>Name</body></html>

  • Need helpcreating a script to read the name of a folder and adding that name into the permissions of that folder

    Need help creating a script to read the name of a folder (which is the AD Username) and adding that name into the permissions of that folder.
    I have over 100 folders which I need to add the AD user to read and write to their own folder
    Hope you guys understand what I mean

    Just to add, Mac in intergrated into AD and all I need is help in creating the script
    Thanks

  • How to get the column name and table name with value

    Hi All
    I have one difficult requirement
    I have some column values and they have given some alias column names but i need to find the correct column name and table name from the database.
    For example value is "SRI" and i dont know the table and exact column name so is there any possibilities to find the column name and table name for the given value
    Thanks & Regards
    Srikkanth.M

    Searching all the database for a word...
    Courtesy of michaels...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    11g upwards
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from (select column_name,
                   table_name,
                   'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
              from cols
             where table_name in ('EMP', 'DEPT')),
           xmltable (str columns result varchar2(10) path '.')
    TABLE_NAME                     COLUMN_NAME                    SEARCH_STRING                    RESULT   
    DEPT                           DNAME                          es                               RESEARCH 
    EMP                            ENAME                          es                               JAMES    
    EMP                            JOB                            es                               SALESMAN 
    EMP                            JOB                            es                               SALESMAN 
    4 rows selected.

  • How to find the column name and table name with a value

    Hi All
    How to find the column name and table name with "Value".
    For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    2 solutions by Michaels (the latter is 11g upwards only)...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from cols,
           xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
           columns result varchar2(10) path '.'
    where table_name in ('EMP', 'DEPT')
    TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
    DEPT                 DNAME                ES                   RESEARCH 
    DEPT                 DNAME                ES                   SALES    
    EMP                  ENAME                ES                   JONES    
    EMP                  ENAME                ES                   JAMES    
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   PRESIDENT
    EMP                  JOB                  ES                   SALESMAN 
    9 rows selected.

  • Update beans after adding columns to DB tables

    I am trying to use JDeveloper 10G , Studio Edition Version 10.1.3.0.4.3673
    I am having difficulty finding out how to update CMP Entity Beans
    after adding columns to DB tables.
    I have found descriptions of how to do these from four sources.
    None of these methods work.
    They all refer to menu options, buttons or fields that aren't in the JDevb IDE.
    List of options that don't exist :
    "Synchronize with Database"
    "attributes"
    "Add from table"
    "New from Table"
    "Fields Tab"

    What version of EJBs are you using?
    The only option I know of for EJBs will be to generate the bean from the table again, or manually add the field to the EJB.
    The "Synchronize with Database" operation is there for ADF Business Components but not for EJBs.

  • Get column names into a VB program, for an SQL query that joins tables

    use [mydatabase]
    select * from InvNum inum
    left join _btblInvoiceLines ilin
    on inum.autoindex = ilin.iinvoiceid
    left join stkitem s
    on ilin.istockcodeid = s.stocklink where InvNumber = 'IVQ0834' or InvNumber = 'IVQ0835'
    I need to get out the column names in a VB program in the same order they would appear in the SQL query above...
    I want to use something like:
    select column_name from information_schema.columns where TABLE_NAME = ....
    except there are several tables involved above so I dont know the format!

    If you execute the query in your program using the SqlDataReader.ExecuteReader method, the column names will be available via the GetName method of the returned reader.  But note that your query may return multiple columns with the same name.
    Dim reader As SqlDataReader = command.ExecuteReader()
    For x = 0 To reader.FieldCount - 1
    Console.WriteLine(reader.GetName(x))
    Next x
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Newly added column in a table not displayed in a related form

    I added a new column (DNAMECONT as varchar2) in a table I created a Form on. I added this new field in my Form as a text field, and on the customized tab of the form wizard, this following code is displayed as expected :
    <TR><TD><#DCONTRACTOR.LABEL#></TD><TD><#DCONTRACTOR.ITEM#></TD></TR>
    But I cannot view it once I run my form.
    did I forget to do something or is there something I did wrong?
    Thank you for your help.
    Bertrand

    Sorry to interupt, as far as I understand, if you add extra column to a table after the form is built and you want to add this new column in your form. When you add new item in your form, the name you give to the item should exactly match the column name of your new column of the table. Now, you said you added a new column called DNAMECONT, but the
    html shown in form wizard is <#DCONTRACTOR.LABEL#>, <#DCONTRACTOR.ITEM#>, two names do seem to match. Is that the problem?
    null

  • How to get the column name and table name from xml file

    I have one XML file, I generated xsd file from that xml file but the problem is i dont know table name and column name. So my question is how can I retrieve the data from that xml file?

    Here's an example using binary XML storage (instead of Object-Relational storage as described in the article).
    begin
      dbms_xmlschema.registerSchema(
        schemaURL       => 'my_schema.xsd'
      , schemaDoc       => xmltype(bfilename('TEST_DIR','my_schema.xsd'), nls_charset_id('AL32UTF8'))
      , local           => true
      , genTypes        => false
      , genTables       => true
      , enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS
      , options         => dbms_xmlschema.REGISTER_BINARYXML
    end;
    genTables => true : means that a default schema-based XMLType table will be created during registration.
    enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS : indicates that a repository resource conforming to the schema will be automatically stored in the default table.
    If the schema is not annotated, the name of the default table is system-generated but derived from the root element name :
    SQL> select table_name
      2  from user_xml_tables
      3  where xmlschema = 'my_schema.xsd'
      4  and element_name = 'employee';
    TABLE_NAME
    employee1121_TAB
    (warning : the name is case-sensitive)
    To annotate the schema and control the naming, modify the content to :
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
      <xs:element name="employee" xdb:defaultTable="EMPLOYEE_XML">
        <xs:complexType>
    Next step : create a resource, or just directly insert an XML document into the table.
    Example of creating a resource :
    declare
      res  boolean;
      doc  xmltype := xmltype(
    '<employee>
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>'
    begin
      res := dbms_xdb.CreateResource(
               abspath   => '/public/test.xml'
             , data      => doc
             , schemaurl => 'my_schema.xsd'
             , elem      => 'employee'
    end;
    The resource has to be schema-based so that the default storage mechanism is triggered.
    It could also be achieved if the document possesses an xsi:noNamespaceSchemaLocation attribute :
    SQL> declare
      2 
      3    res  boolean;
      4    doc  xmltype := xmltype(
      5  '<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      6             xsi:noNamespaceSchemaLocation="my_schema.xsd">
      7    <details>
      8      <emp_id>1</emp_id>
      9      <emp_name>SMITH</emp_name>
    10      <emp_age>40</emp_age>
    11      <emp_dept>10</emp_dept>
    12    </details>
    13   </employee>'
    14   );
    15 
    16  begin
    17    res := dbms_xdb.CreateResource(
    18             abspath   => '/public/test.xml'
    19           , data      => doc
    20           );
    21  end;
    22  /
    PL/SQL procedure successfully completed
    SQL> set long 5000
    SQL> select * from "employee1121_TAB";
    SYS_NC_ROWINFO$
    <employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceS
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>
    Then use XMLTABLE to shred the XML into relational format :
    SQL> select x.*
      2  from "employee1121_TAB" t
      3     , xmltable('/employee/details'
      4         passing t.object_value
      5         columns emp_id   integer      path 'emp_id'
      6               , emp_name varchar2(30) path 'emp_name'
      7       ) x
      8  ;
                                     EMP_ID EMP_NAME
                                          1 SMITH

  • Reg: Adding field names in table control

    Hi
    I am new to table control ,instead of going with table control wizard i am proceeding with table control.
    I have added all the fields as per my requirement, i have added like matnr ,maktx. above these fields i would like to add material and material description..
    can any one suggest me a way to add those fileds.
    And my requirement is i need to display my contents in the internal table..
    if any got sample coding plz do send me.
    Thanks and regards
    Arun Joseph

    Hi Arun joseph,
      In SE51 -> Layout, Press Input/Output button and put it at the end of all your columns in your table control and give variable name ( for example fs_tablecontrol-extrafield ) and press Text Field button and put it in the place of heading give text and save it activate it.
    In your program add the field in data declaration and do furthor logic for that extra field/fields.
    Note: you can add the both fields like this only.
    Regards,
    Mahi.

  • Store Column-Name into variable

    Hello from germany
    I got stuck with following:
    How is it possible to store the name of a column into a variable or is it possible to put an index "on" a column?
    The reason for this: I need to fill and check a complete column!
    Thanks for Your help!
    Best regards
    Marlon

    Those sure are unrelated questions. Lets say we have a table like this:
    SQL> CREATE TABLE t (
      2    a  number,
      3    b  varchar2(8),
      4    c  date );
    Table created.You can get a column name like this:
    SQL> set serveroutput on
    SQL> DECLARE
      2    second_col   VARCHAR2 (30);
      3  BEGIN
      4    SELECT column_name
      5      INTO second_col
      6      FROM user_tab_columns
      7     WHERE table_name = 'T'
      8       AND column_id = 2;
      9    DBMS_OUTPUT.PUT_line(second_col);
    10  END;
    11  /
    B
    PL/SQL procedure successfully completed.
    SQL> You can put an index on a column like this:
    SQL> CREATE INDEX t_n1 ON t(b);
    Index created.And you can add data to the table like this:
    SQL> insert into t(a, b) values (4, 'asdf');
    1 row created.
    SQL> select * from t;
             A B        C
             4 asdf
    SQL>

  • UIX get EO column names into a messageChoice

    I'm working on building a search function into my form which will allow the user to enter an arbitrary search string into a text box and then provides a list of columns in the table to be searched on. Is there any way to populate that list box (messageChoice) with the column names from the database dynamically? And if so, could I have the value set to those and the label set to the 'human readable' label text used on my forms?
    Nick

    Try looking at the section "Apply a filter to the Lov Window" here:
    http://otn.oracle.com/products/jdev/howtos/10g/adf_uix_lov_ht/index.html

  • How can I change a column name in table (JDeveloper 10.1.3.3)?

    I'd like to change a table column name, for example instead of "FirstName" I'd like "Name".
    Here is the preview: http://img208.imagevenue.com/img.php?image=86575_firstname_122_578lo.JPG
    Thank You in advance!

    Now I have following problem: When I change "Label text" to column which has "Combo box" (Department insted of DepartmentId) I do not have my combo box anymore, just DepartmentId (Number). I have created binding... (DepartmentId -> Department Name) Why is this happening?
    http://img151.imagevenue.com/img.php?image=47670_firstname_122_862lo.JPG
    Can I change my attribute name in data model?
    BTW I use ADFBC Swing
    Sorry on my bad English ...
    thank you
    Message was edited by:
    user638810
    Message was edited by:
    user638810
    Message was edited by:
    user638810

  • SSAS Tabular - Adding Column to a table gives error "Object reference not set to instance of object"

    If I make changes to a table in SSAS Tabular Visual Studio, the newly added column gives error as "Object
    reference not set to instance of object"

    Hi VikasJain13,
    According to your description, you get the "Object reference not set to instance of object" error when adding columns in Tabular. Right?
    Generally, it throws this error when the internal code is accessing the property of an empty object. As you mentioned it happens when you make changes on a table, mostly it means that table is already a empty object. Please re-process your tabular to see
    if this table is still existing. 
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

Maybe you are looking for

  • Getting associated values from F4 Help

    Hi all, i have already searched about it on SCN but not get any thread where i can resolve my problem so here i am posting it, i have created a screen in which i have provided F4 help, in this F4 help i am showing name and associated number of employ

  • How to transfer data in change log table of dso to z-table using abap code

    Hi  can you please explain me how to transfer data in change log table of dso to z-table using abap code ,with out using Function module concept

  • File Adapter: picking files from multiple directories

    Hi all, In a sender file communication channel with Transport Protocol FTP, There are 2 parameters for Picking up the file called Source Directory and Filename. If I want to pick the files from 2 or more directories, What needs to be done. Or is it p

  • Color correction questions

    I have a few questions about the color correction tools in Premiere CS4. 1. Suppose that the colors in my shot are basically correct, but the blacks have a tint to them.  Which is the best color correction filter to use to correct for this? 2. Do any

  • Printed doc topics listed in WinXP Recent Documents list

    I recently upgraded to RoboHelp 9 from 7. I generated a printed doc and each topic is listed in the Recent Documents list in Windows XP, as follows: The file names all begin with $HtmlDoc_Chapter_... By the way, these files can't be found once you cl