Handling any query using JDBC ?

Hi there,
I was wondering if their actually exist a way of handling/processing any SELECT statement a user would enter.
ex: the user enter SELECT * FROM SCOTT.EMP;
Is it possible to retrieve using JDBC teh metadata associated with "*" ?
any help would be welcome.
Regards
Eric.

When you get back the result of a query in JDBC you get a ResultSet object.
Off of that you can obtain a ResultSetMetaData object which fully describes the result set - column names, types, scale and precision, etc. You can use that for dynamic processing of your result set, for example if you wanted to display it in a table.

Similar Messages

  • How to use unload query using JDBC with Informix database

    Hi friends,
    How can i use unload query using JDBC with Informix database?
    When i use it as "unload to 'abc.txt' select * from ........" it gives syntax error.I want to take the data of a table to a file.With dbaccess i can use it but i need to do it using jdbc.
    Thanks,
    Raneesh.

    To the best of my ability to tell, the right way to use this product from within Power Query would be to use its API. Unfortunately, we don't currently support either of the methods needed to be able to authenticate with the service (OAuth 2.0 and a relatively-custom
    digest-based method). Adding a mechanism to allow use of arbitrary OAuth-protected resources is a fairly high priority for us, and I hope we'll be able to deliver something before mid-2015.
    Scraping the website is very hard to do well -- both from an authentication and from a data discovery perspective.

  • Executing Select query using JDBC Receiver Adapter

    I created couple types in Oracle and also new function instead of procedure
    Can I execute the above query using JDBC Receiver Adapter.
    select *
    from  the ( select cast( apr.get_distribut('', '', '', 'hdfcgd', 'CAN') as dsrTable )
             from dual );
    If possible how my message structure should look like...

    Hi vikram,
       If you use JDBC as Receiver Adapter you can only post the data to the data base I do no think so we can select the records from the data base.
       If you use JDBC as Sender hope,we can the select query in the sender communication channel.
        Hope I am clear.
      Thanks and Regardds,
      Chandu.

  • Retrieving Schema details from any database using JDBC.

    Hi,
    We are in a process of developing a tool to extract the schema level details from any database. Following are the areas where we are facing difficulties. Please give us your valuable comments.
    1.How can I get all the depending views of a particular table or vice- versa ?
    2.If there is a join view in my database.How can i get the information
    for all the join columns?
    3. suppose the view in the database is built using some select and omit
    Clause. how can I get those conditions using JDBC ?
    4.for a viewcolumn , how can I find out, it refers to which column of
    a table ?
    5.For a table how can I get the information about its unique
    constraints and check constraints
    6.How can I check , a constraint is enabled or disabled on any table?
    I will appreciate your response.

    Hi,
    We are in a process of developing a tool to extract
    ct the schema level details from any database.
    Following are the areas where we are facing
    difficulties. Please give us your valuable comments.
    1.How can I get all the depending views of a
    particular table or vice- versa ?No way with JDBC. You need to create something DBMS specific
    2.If there is a join view in my database.How can i get
    the information for all the join columns?see 1)
    3. suppose the view in the database is built using
    some select and omit
    Clause. how can I get those conditions using JDBC
    BC ?see 1)
    4.for a viewcolumn , how can I find out, it refers to
    which column of a table ?see 1)
    5.For a table how can I get the information about its
    unique constraints and check constraintsThe DatabaseMetadata object can return that information
    6.How can I check , a constraint is enabled or
    disabled on any table?I don't think that this is possible with JDBC (not sure
    if that information is returned from the DatabaseMetadata
    object). You will need to code something DBMS specific
    I think there is something with deferred constraints which
    can be checked by JDBC but I'm not sure about that either
    Thomas

  • Handling million rows using jdbc

    approximately how much time would it take to use jdbc and do a simple data import from an oracle database having 500 million rows?

    Without a lot more information my answer would be too long.
    It is likely that something is wrong with the design of a project if it involves bring 500 million records into a running java application.
    Using a 1000 byte record size it would take 19 hours just to move the data over a 100mbit ethernet connection.

  • Deciphering column names in a join query using jdbc

    hi all....
    I am making a database adapter for a generic report generater. This adapter would be forming queries involing various tables. There are two ways of doing it . I fire an sql on parent table to get the keys and then go to child table for each one of them or i form a join query to get desired result.
    i want to go with the later approach where my query would be forming a join. The problem comes when table involved in this join has columns with the same name. for eg if a column "NOTE" is there in table A as well as table B on which i have a join. Resultset returns me with two "NOTE" columns and i cannot recognize which one belongs to which table.
    all API calls including getString("Note") seems to be referring to the first occurence of "Note" column.
    Also getTableName() and getSchemaName() APIs on resultsetMetadata doesnt return in anything in case of joins.
    Any pointers would be most appreciated.
    cheers
    vivek

    thanks for suggesting this solution ... though i had thought of the same onece .... unfortunately i cannot implement something like this coz out of the result set i have to instantiate an object hierarchy depending on the schema ....
    this also puts me in a doubt whether i can use join in my case.
    for eg ... .
    lets say we have a customer talbe and and address table which has one to many relationship .... one contact can have multiple addresses.
    Assuming a contanct "Joe Bloggs" having 3 addresses ...a query like following
    select contact.firstname contactfirstname , address.streetname addressstreetname from contact , address where contact.contactid = address.contactid
    this would return me 3 rows and i can also recognize various columns with their aliases ..
    but i would lose an important fact that i have to create one java object for contact class and 3 instances for addresses which i have to return finally.
    this means that i would like to return an object hierarchy with one contact object and 3 address object underneath it linked with contactid.
    Any other suggestions after reading the complete requirement are most welcome ...sorry for not puting the entire thing at first.
    i guess the only soln left is to visit contact and address table separately. :(

  • Database package for handling SQL queries using JDBC/ODBC bridge

    I perform a package using J2ME which can stores the contact.It consisting of the fascilities of the editing,Inserting, Deleting,Updating records
    i have write import statements as
    import javax.microedition.midlet*;
    import javax.microedition.lcdui.*;
    but when i write import java.sql.* error message shown AS this package does not exist.
    So for J2ME using J2ME wireless toolkit 2.5 cldc which package i want to import to implement the sql statements i implement the Database using the text Files.
    Requirement is that all SQL statements are implemented.also Which other equivalent packages are there for handling the databases in J2ME.
    Please tell me all the package & Answer of the above problem.

    Hey
    I was told that I can (through Java code) read all the registered DSNs and that way basically modify my application to populate it with a list of databases in the system and then when the user clicks on a database, the program would function as before...i.e. read the list of tables with it..yadda yadda yadda
    Can anyone guide me on how to do that? read a list of DSNs in the system etc

  • Find out query using specific DB link

    Hello,
    Environment: 11G and Ksh script
    Currently our Client is upgrading to new environment, so I need to find out which query in our Database use DB link to pull data from that client will be impacted.
    for example,
    select * from table_1@DB_link_1All our SQL are embedded in UNIX script, so I use command line to search any scripts contain '@DB_link_1' but not find anything.
    is it possible to search any dynamic view or any suggestion to search inside ORACLE database to see if any query using this 'DB_link_1'? I tried 'dba_db_links' but this does not show which query is using which DB link.
    Thanks,
    Thomas

    frank wrote:
    Hello,
    Environment: 11G and Ksh script
    Currently our Client is upgrading to new environment, so I need to find out which query in our Database use DB link to pull data from that client will be impacted.
    for example,
    select * from table_1@DB_link_1All our SQL are embedded in UNIX script, so I use command line to search any scripts contain '@DB_link_1' but not find anything.
    is it possible to search any dynamic view or any suggestion to search inside ORACLE database to see if any query using this 'DB_link_1'? I tried 'dba_db_links' but this does not show which query is using which DB link.
    Thanks,
    Thomashttp://download.oracle.com/docs/cd/E11882_01/server.112/e17110/statviews_1068.htm#REFRN20053
    REFERENCED_LINK_NAME      VARCHAR2(128)           Name of the link to the parent object (if remote)
    "

  • Any reported problems using jdbc over a WAN?

    If im trying to connect to a Database that's on a WAN will I experience any issues in using jdbc to connect and execute queries to that database?
    I know problems would come up if my wan network is slow, but has jdbc been able to handle long distance database queries? timeout values?

    but why?
    is it because of security? If a company had a database with your personal info hanging out on the Web for anyone to query without any validation or security, how would you feel about it?
    design pattern issues? It's just good layered design.
    just doesnt make sense?Not in my opinion.
    have u experienced/heard of any problems of
    connecting to a database over a WAN and executing
    queries?You don't say anything about who the client is. If the database is behind a firewall, outside clients shouldn't be able to access the port where the listener is running. Only port 80 should be open on that firewall.
    So you either write a servlet that listens on port 80 for HTTP requests from a browser-based client OR you ask your firewall admin to punch a hole in the firewall and open up the port on which your database is listening for queries and use a Swing client.
    If s/he agrees to do it, quit immediately. It means your company doesn't know anything about security.
    %

  • Strange results from JDBC  Query using a VARRAY

    Here's one for you experts:
    I have a 9i release 2 db set up, to which I connect via the JDBC thin
    driver. I have a JavaServer Pages application that needs to read a VARRAY
    from a table and then use the contents of the VARRAY. Here's the code in
    the JSP that does that:
    resultset=db.executeQuery
    ("SELECT IMAGE_lIST FROM PAGE_IMAGE_ARRAY WHERE PAGENAME = " +
    pagename);
    oracle.sql.ARRAY array =
    ((oracle.jdbc.driver.OracleResultSet)resultset).getARRAY(1);
    imageList = (String[])array.getArray();
    for(int count=0; count<imageList.length; count++)
    out.println("<p>The image at position " + count + " in the array is
    the image titled: " + imageList[count]);
    The JSP compiles and runs fine, but the output is as follows:
    The image at position 0 in the array is the image titled: 0x7465737431
    The image at position 1 in the array is the image titled: 0x7465737432
    The image at position 2 in the array is the image titled: 0x7465737433
    The image at position 3 in the array is the image titled: 0x7465737436
    A query using SQL*Plus verifies that the actual values of the elements of
    the array are 'test1', 'test2', 'test3', 'test6'. Notice that the last
    digit in the hex(?) output matches the last digit of the actual string.
    What's causing this? It looks like a data type mismatch, but I would have
    thought that such an error would have triggered a compile-time error.
    Any help is greatly appreciated.
    Regards,
    Dave Penn

    Dave,
    The following should help.
      1  select rawtohex('test1') val1,
      2  rawtohex('test2') val2
      3* from dual
    SQL> /
    VAL1       VAL2
    7465737431 7465737432
    SQL> select rawtohex('1') val1,
      2  rawtohex('2') val2
      3  from dual;
    VA VA
    31 32

  • Use JDBC to query data for JSP Report

    Hi all,
    I met a trouble when use JDBC to query data,
    it can show data in report builder, but get error when call from url for exxample: http://localhost:8889/reports/TestJDBCReport.jsp
    found error message:
    javax.servlet.jsp.JspException: rwlib-1: REP-4100: Failed to execute data source. REP-0069: Internal error JDBCPDS-62000:Invalid sign-on parameter P_JDBCPDS
    javax.servlet.jsp.JspException: rwlib-1: REP-4100: Failed to execute data source.
    REP-0069: Internal error
    JDBCPDS-62000:Invalid sign-on parameter P_JDBCPDS
    anyone know pls help me
    Many thanks

    As a general rule, it's a good idea to separate the
    presentation (JSP and HTML) from the business rules
    (database access). I know you didn't do that on the
    AS/400, you had display files and business logic in
    the same program (at least, we certainly do in ours),
    but it's a good policy to follow in the web world.
    That means, don't put your database access code in
    the JSP. Other than that, it depends on the data.
    If you have simple data (e.g. customer's name and
    d address) then a Java bean would suffice. If you
    have complex data (e.g. customer's payment history)
    then a bean still might suffice. You would use an
    "include" if you had some data (static or dynamic)
    that you wanted to appear in several different pages
    in the same form.Thanks, I figured putting the code in the JSP was not the best way, but I wasn't sure about the other options.

  • Is there any documentation on how to use JDBC in ALBPM?

    I'm trying to connect to a DB using DriverManager class.
    1) I've defined an externalResource of type SQL Database.
    2) When I execute the following code:
    //externalResourceURL is the URL of the SQL Database external resource created in 1), same for user and password
    con as java.sql.Connection = DriverManager.getConnection(arg1=externalResourceURL, arg2=user, arg3=password)
    3) I get the following error: This driver is locked for use with embedded applications.
    Is there any tutorial or documentation on how to use JDBC in ALBPM?
    Thanks in advance

    I don't know of any documentation off hand... but what are you trying to do? I haven't needed to to make a connection using the DriverClass....
    If you aren't using dynamicSQL... you can just catalog the database, and make direct sql calls (not recommended)... but if you catalog it, then just an INSERT command works... or UPDATE... etc
    logMessage "Starting insert."
    INSERT INTO MYTABLE(id, name) VALUES ("2", "kevin");
    logMessage "Finished insert."Check out the studio help under SQL Keywords for more info on that...
    HTH
    -Kevin

  • How to know if an Infobject is used in any query

    Hi!!!
    can somebody tell me how can i understand  ( by technical name ) if an infoobject is used in any query ...in every mode:
    as a basic infoobject
    or in a structure of query
    or to build a restrected keyfigure
    or to build a rcalculated keyfigure.
    table RSZELTDIR doasn't give this information.
    It refers only to  query, variable, structure or template,..not also to based infoobject ( infoobect without any delimitation )
    i can't use the technical name to do this search in RSZELTDIR.
    thank you very much
    Fabio

    Yes, Raj is right just go to the Cube/infoobject and click on where used button will show u list of queries/query elements.
    or u can go to metadatarepository and look for that perticular object - click on it and it will give list of other objects, transfer rules, update rules, queries etc.... In short everything related to that object will be shown there.
    Hope this helps.
    KS

  • Is there any way to get the query used in discoverer from backend??

    Hi All,
    I am new to dicoverer.
    Is there any way to get the query used in discoverer from backend??
    Thanks,
    Sachin

    Hi,
    you can view the SQL from within the discoverer menu:
    in desktop: View-> SQL Inspector
    in Plus: Tools-> Show SQL
    The SQL in the DB tables is encrypted so it's a problem getting it from there.
    You can export the workbook into SQL but it is not working for every worksheet (subquery, inline pivot tables...)
    you can create a batch file to export them all using the output of this script:
    select null,null,'echo off'
    from dual
    union all
    select distinct
    qs.qs_doc_name Workbook_name,
    qs.qs_doc_details Worksheet_Name,
    'start /wait <path>\dis51usr.exe /connect '||'&p_user_name'||'/'||'&p_password'||'@'||'&p_env'||' /apps_user /apps_responsibility "&responsibility" /opendb '||
    chr(34)||qs.qs_doc_name||chr(34)||' /sheet "'||qs.qs_doc_details||'"'||' /export SQL "C:\Export Discoverer SQL\'||qs.qs_doc_name||'-'||qs.qs_doc_details||'.sql" /batch'
    from eul_us.eul5_qpp_stats qs
    where qs.qs_doc_name is not null
    --order by 1,2
    union all
    select null,null,'echo off'
    from dual
    union all
    select null,null,'exit'
    from dual

  • How to write the given query using 'ANY ' operator

    Hi,
    How to write the given query using 'ANY ' operator , I dont need to fetch to grade_master table twice in database, just need to fetch within the result set.
    SELECT dsg_code,dsg_name,dsg_grade FROM designation_master WHERE dsg_orgn='&&Orgn' and dsg_ctry='&&ctry'
    And dsg_loc ='&&loc' And dsg_oru = '&&oru' and dsg_grade in decode('&&radio_group',
    1, SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&Orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'),
    2, SELECT grd_code FROM grade_master WHERE grd_osm_code > (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code),
    3, SELECT grd_code FROM grade_master WHERE grd_osm_code < (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'))
    thanks
    rincy

    Hi,
    One thing I understood my your issue is you want to perform, execution of query once or fetch the results sets my minimizing the number of times executions of queries. It would be hard for us to check in this way, atleast provide some temporary data and some business rules. Only I can IN, >, < (queries logical conditons on inner query)
    - Pavan Kumar N
    - ORACLE OCP - 9i/10g
    https://www.oracleinternals.blogspot.com

Maybe you are looking for

  • How can I register iPhone which is registered to another Apple ID

    I can't register my iPhone 4S because I bought it from another people and its registered to another apple id. When I try to register it says that my iphone is registered to another account. Please help :)

  • EventListeners in loaded smp swf

    I've successfully set up a shell swf to load the smp.swf. I pass the flashvars to the URLRequest, which works great. Now, I'm trying to do a couple of things. 1) When the first streamed movie (rmtp) finishes, I want to register the event to add some

  • DB links and GLOBAL_NAMES

    Hello, We are facing a situation where we need to do the following: 1.OracleDB1:user1.1, user1.2 2.OracleDB2:user2.1, user2.2 3.AdvancedReplication between OacleDB1 and OraleDB2 4.databaselinks: DBL1:in user1.1 schema to user2.1 DBL2:in user1.2 schem

  • Web proxy URL Filter

    Hi I am currently using regular expressions to filter out undesirable websites on my web proxy server. I currently use .*://.*\.*mail.*/.* to filter out any url's that contain the word 'mail' to prevent access to the many webmail sites. however, this

  • Are Things Looking Grim For Developer2000?

    Hi all D2K professionals, There is a buzz in the S/W Scenario these days suggesting that D2K is down in a big way in the Mrket. Is this True? I would like some comments from all experienced D2K Professional as well the Oracle Team (Both Forms and Rep