Need suggestion in getting data using JDBC

Hi all need suggestion,
     i had a VO corresponding to database table.
     when i am try to get the records from that table,
     how can i initialize the particular column value to the
     corresponding VO setter method.
     please do the needful.

Hello inform2csr,
Your question is not so clear.
Can you be more precise?
What is VO?

Similar Messages

  • Need a suggestion in getting data using JDBC

    Hi,
    There is a Emp table in database.
         And there is a corresponding Value Object(Contains getter and setter
         methods for columns of Emp table).
         If i fire a query to Emp, then the records will be stored in ResultSet.
         I am passing the table as a paremeter to a method.(so that no. of columns
         should vary)
         Now my problem is how can i initialize each column value getting from
         ResultSet into corresponding VO setter method.

    Like this probably: vo.setX(rs.getInt("X"));

  • Need suggestion to get data from change log table of ODS.

    Hello,
    There is a case where i am loading opportunity header data from header ODS and opportunity item data from item ODS in the opportunity cube.
    Status (1= OPEN, 2= WON ETC) of the opportunity are available only in header ODS and not in item ODS.
    While loading data from header ODS to cube, I am loading it directly but while loading data from item ODS to cube i am using active data table of header ODS as a lookup in the update rule from item ODS to cube. I am selecting status from the active data table of header ODS while loading data from item ODS to cube.
    Since active data table will have only after image records, there is some data mismatch in the report as i am selecting data from active data table of header ODS while loading data from item ODS to cube.
    I need to select data from Change log in order to get before image also instead of active data table in order to overcome this issue. Is there any way by which i can do selection from Change log instead of active data table as change logs are generated at run time.
    Please let me know if you have any suggestions.
    Regards,
    Sanjay Chaurasia.

    Hi,
    You can use the changelog table of the DSO.
    Right click manage the Header DSO, go to the contents tab and click Change Log table. There you can see the technical name of the Change Log table.
    In the update rule Routine, give the tech name of Change log table instead of Active table name.
    Hope it helps.
    Krishna

  • Suggestions needed on retracting bw data using Infospokes

    Dear all,
    Unable to dump the BW 3.5 Info cube data using info spokes.
    Info cube contains huge historical data (5 Crores),
    we are using maximum selection conditions on available time characteristics in info cube.
    Regards,
    Sreehari.

    Hi Sreehari,
    It will always fail for such a huge dataset. You can reduce dataset by applying filter in selection tab of infospoke.You can divide data of the cube may be on 0FISCYEAR or some other field and then dump based on that field. That will run better.
    Thanks,

  • DISPLAY SPATIAL DATA USING JDBC ON A JAVA FRAME

    I am trying to set up some spatial data and need help in getting some sample
    code for displaying the data on a Java Frame using JDBC.
    The shapes I am setting up are simple polygons, lines, circles. I was going
    through the samples in the demo directory under $ORACLE_HOME/md/demo/examples, but could not find any JDBC
    I would really appreciate if you can point me towards some sample code and any other spatial resources.
    Madhukar

    Here you go. It uses JDBC to fetch geoms, convert them into Java JGeometry objects, which then create Java2D shapes (these are functions of the public sdoapi.jar library). It then uses some class in the sdovis.jar library (the rendering engine of MapViewer) to setup the necessary viewport transform. If you know how to setup the viewport transform, then you dont even need sdovis. sdovis.jar is found in an deployed MapViewer's WEB-INF/lib directory. Or you can extract it from the mapviewer.ear's web.war file.
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    import oracle.jdbc.OracleDriver;
    import oracle.sdovis.*;
    import oracle.sdovis.style.*;
    import oracle.sdovis.util.*;
    import oracle.spatial.geometry.JGeometry;
    import oracle.sql.STRUCT;
    * A very simple program that shows stuff from db in a JFrame
    * <p>
    public class tilsvgui2 extends JFrame
      final static int mapWidth  = 640;
      final static int mapHeight = 480;
      static JSDOGeometry geom = null;
      public tilsvgui2()
        setSize(mapWidth+40, mapHeight+40);
                    setVisible(true);
        this.addWindowListener(new java.awt.event.WindowAdapter() {
          public void windowClosing(WindowEvent e) { System.exit(0); }
            public void paint(Graphics g)
                    super.paint(g);
        int w = this.getWidth(), h = this.getHeight();
        Insets inset = this.getInsets();
        double[] mbr = geom.getMBR();
        //from sdovis; it will setup the viewport transform
        XFViewPort xfp = new XFViewPort();
        xfp.setDeviceView(inset.left, inset.top, w-inset.left-inset.right-1, h-inset.top-inset.bottom-1);
        xfp.setDataView(mbr[0], mbr[1], mbr[2], mbr[3]);
        AffineTransform af = xfp.getAffineTransform();    //get the viewport transform
        Shape shp = geom.createShape(af);    //create a proper shape that fits the viewport
        Graphics2D g2 = (Graphics2D) g;
        g2.setColor(Color.red);
        g2.drawRect(inset.left, inset.top, w-inset.left-inset.right-1, h-inset.top-inset.bottom-1);
        //draw the shape itself
        g2.setColor(Color.blue);
        g2.draw(shp);
      public static void getStuff() throws Exception
        System.out.println("Loading geometry...");
        Connection conn = getConnection("mapsrus.us.oracle.com", "1521", "orcl", "scott", "tiger");
        Statement  stmt = conn.createStatement();
        ResultSet  rset = stmt.executeQuery("select geom, totpop from counties where county='Merrimack' and state_abrv='NH'");
        while(rset.next())
          STRUCT st = (STRUCT) rset.getObject(1);
          geom = JSDOGeometry.loadFromDB(st);
          int population = rset.getInt(2);
          break; //displaying only the first geometry
        rset.close();
        stmt.close();
        conn.close();
      private static Connection getConnection(String host,
                                              String port,
                                              String sid,
                                              String username,
                                              String password)
        throws SQLException
        String thinConn = "jdbc:oracle:thin:@"+host+":"+port+":"+sid;
        Driver d = new OracleDriver();
        Connection conn = DriverManager.getConnection(thinConn,username,password);
        conn.setAutoCommit(false);
        return conn;
      public static void main(String[] args)
        try{
          getStuff();
        }catch(Exception e)
          e.printStackTrace(System.err);
        new tilsvgui2();
    }

  • Reading CLOB data using jdbc thin driver

    Hi,
    When I try reading data for a CLOB column using thin jdbc driver, I get the following error message
    "Exception: ORA-06550: line 1, column 22:
    PLS-00302: component 'GETCHUNKSIZE' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored".
    This error message is displayed when the call is made to get the character stream from the Clob object.
    Do I need to any server side setup before I can access CLOB data from the database?
    thanks.
    Puru Balakrishnan

    I updated to the latest jdbc drivers, 816classes12b.zip, and the problem went away.
    null

  • Need advice for getting data service while traveling abroad

    I will be traveling in Norway and England and want to be able to use GPS on my Galaxy S4.  I can get along without voice service, and can rely on wi-fi for email and internet access.  I will be traveling for about 3 weeks.  Any suggestions?

    All the advise you need is right here Spokaneman! We want you to enjoy your trip to Norway and England. Yes, you can use your phone for data while traveling. Here is a link to our Global trip planner to get all the information about cost and what is needed to use your phone http://vz.to/1aGvDAs . You can add our bundle plan for 100mb for $25.00 per month or voice/data bundle for 100minutes/100sent messages and 100mb for $40.00 per month . You can also pay as you go with is $0.02 cent per KB and $20.48 per mb. Voice calls and text are extra if you're interested in those features.
    KinquanaH_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • Need Suggestion in displaying data in ALV.

    Hi All Experts,
    I have a scepic scenario for which I need your inputs. I am preparing a report which will display data foe entries made in time sheet. The entries in time sheet can be made for anything like a change request on an incident etc. It will have various output fields
    And also dates for which entries are made. So it can have date from 1 to 31. This all is
    to be displayed in ALV. Now the report can be displayed in two Summarised ways.
    One summary can be for a user and another for the  object type(incident, change request).
    Now if the user wants to see this report for a period more than a month  then I have to summarise it against a month too. So am not sure how to handle this. Which type of ALV function module to be used to display this?
    Regards,
    Saket

    hello,
    I would suggest to go for GRID display - for that you can use either function module or class.
    Tips:
    If it also need to be summarised by month then add an extra field in fieldcatalog as monthid / monthname.
    also it's better to have an extra field for object tyoe (Incident/ change)...
    Thanks.

  • Need suggestion in method to use

    Greeting.
    I'm doing data mining stuff and the data look like this:
    a     c
    1     1
    2     1
    3     1
    7     1
    8     1
    6     2
    7     2
    8     2
    9     2
    10     2This data will be the input. I need to calculate a 'split-point' in 'a' according to class 'c' i.e. 1 and 2. I wanna group 'a' into two class. Let say after calculation the split point is 8, then output will be {1,2,3,6,7,8} and {9,10} for 'a' means 1,2,3,6,7 and 8 will become {1,2,3,6,7,8}
    First I need to sort 'a'. 'a' and 'c' are parallel. And then I need to calculate probability of 'c' for a point let say 8, number <=8 that is '1' in 'c'. In this case will be 5/8.
    This is some description.
    My problem is: Which way will be easier to do this? Using what kind of input? (excel, txt, csv) ?
    How to get start?
    Edited by: Raiko on Apr 26, 2010 9:18 PM
    Edited by: Raiko on Apr 26, 2010 9:20 PM
    Edited by: Raiko on Apr 26, 2010 9:23 PM

    Raiko wrote:
    This data will be the input. I need to calculate a 'split-point' in 'a' according to class 'c' i.e. 1 and 2. I wanna group 'a' into two class. Let say after calculation the split point is 8, then output will be {1,2,3,6,7,8} and {9,10} for 'a' means 1,2,3,6,7 and 8 will become {1,2,3,6,7,8}Sorry, but your description, coupled with the data you supplied, makes no sense to me.
    How are you supposed to "split" column a according to 'c', when the values 7 and 8 appear for both 'c' values?
    More description please.
    My problem is: Which way will be easier to do this? Using what kind of input? (excel, txt, csv) ?I'd start with .txt. Mind you, I still don't understand the requirements...
    Winston

  • Getting date using week number and year

    hi!
    how can i get the date for a given year using a given week number?
    assuming that the first day will be sunday?
    for example..
    the input year is 2006,
    then the week number is 30
    the result should be july 23 2006...
    please help.. Thanks!

    play a little with the Calendar class. You might need some setters and maybe the add method to scroll to the previous Sunday.

  • Not able to fetch updated data using jdbc and oracle 10g

    Whenever i m updating the data and fetching the same record after updating i m not able to get the fresh/new updated data , old record is fetched every time, but when i checked in database the record gets updated successfully , even if i fire the query two times after 10 seconds using Thread.sleep even then problem persist.
    Please help me out!!!!!!!!
    Implementation has been stucked up!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :(

    Well its okWhat is OK? Your stuff working now?
    i m doing the same thing Apparently not.
    please go thru the below code fragment:
    code for Update :::
    DataAccessBean1 partsHistoryDataAccessBean = new
    DataAccessBean1(context);
    partsHistoryDataAccessBean.setData(data);
    partsHistoryDataAccessBean.update();
    After Updating i m forwading it to the other servletForwarding what? Why do you need another servlet? Just do the query, put the new data into the response object, and return.
    According to your assumption i should get the updated
    data on the other screen but Nope, you don't understand what I'm saying.
    %

  • Need SQL to get data

    Hi All,
    There is a table TASK with columns TASK_NAME,IS_TASK. IS_TASK column has only two distinct values 0(means PHASE) and 1(means TASK). The hierarchy is a PHASE can have one or more TASKS, but the name of PHASE and TASK is in TASK_NAME column and separated only by IS_TASK columns value. The result set I need is PHASE_NAME,TASK_NAME separately.
    Please help me.
    Thanks & Regards

    Please consider the following when you post a question.
    1. New features keep coming in every oracle version so please provide Your Oracle DB Version to get the best possible answer.
    You can use the following query and do a copy past of the output.
    select * from v$version 2. This forum has a very good Search Feature. Please use that before posting your question. Because for most of the questions
    that are asked the answer is already there.
    3. We dont know your DB structure or How your Data is. So you need to let us know. The best way would be to give some sample data like this.
    I have the following table called sales
    with sales
    as
          select 1 sales_id, 1 prod_id, 1001 inv_num, 120 qty from dual
          union all
          select 2 sales_id, 1 prod_id, 1002 inv_num, 25 qty from dual
    select *
      from sales 4. Rather than telling what you want in words its more easier when you give your expected output.
    For example in the above sales table, I want to know the total quantity and number of invoice for each product.
    The output should look like this
    Prod_id   sum_qty   count_inv
    1         145       2 5. When ever you get an error message post the entire error message. With the Error Number, The message and the Line number.
    6. Next thing is a very important thing to remember. Please post only well formatted code. Unformatted code is very hard to read.
    Your code format gets lost when you post it in the Oracle Forum. So in order to preserve it you need to
    use the {noformat}{noformat} tags.
    The usage of the tag is like this.
    <place your code here>\
    7. If you are posting a *Performance Related Question*. Please read
       {thread:id=501834} and {thread:id=863295}.
       Following those guide will be very helpful.
    8. Please keep in mind that this is a public forum. Here No question is URGENT.
       So use of words like *URGENT* or *ASAP* (As Soon As Possible) are considered to be rude.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need suggestions for imporving data load performance via SQL Loader

    Hi,
    Our requirement is to load 512 (1 GB each) files in Oracle database.
    We are using SQL loaders to load files into the DB (A partitioned table) and have tried almost all the possible options that come with sql loaders (Direct load path, parallel=true, multithreading=true, unrecoverable)
    As the tables is growing bigger in size, each file load time is increasing (It started with 5 minutes per file and has reached 2 hours per 3 files now and is increasing with every batch- Note we are loading 3 files concurrently on the target table using the parallel = true oprion of sql loader)
    Questions 1:
    My problem is that somehow multithreading is not working for us (we have multi CPU server and have enabled multithreading=true). Could it be something to do with DB setting which might be hindering the data load to be done in multiple threads?
    Question 2:
    Would gathering stats on the target table and it's partitions help improve load performance ? I'm not sure if stats improve DML's, they would definitely improve sql queries. Any thoughts?
    Question 3:
    What would be the best strategy to gather stats on this table (which would end up having 512 GB data) ?
    Question 4:
    Do you think insertions in a partitioned table (with growing sizes) would have poor performance as compared to a non-partitioned table ?
    Any other suggestions to improve performace are most welcome !!
    Thanks,
    Sachin
    Edited by: Sachin Tiwari on Mar 13, 2013 6:29 AM

    2 hours to load just 3 GB of data seems unreasonable regardless of the SQL Loader settings. It seems likely to me that the problem is not with SQL Loader but somewhere else.
    Have you generated a Statspack/ AWR/ ASH report to see where all that time is being spent? Are there triggers on the table? Are there bitmap indexes?
    Is your table partitioned in a way that is designed to improve the efficiency of loads so that all the data from one file goes into one partition? Or is data from each file getting inserted into many different partitions.
    Justin

  • Hi, i'm new in lab view. i'm using 3'rd party daq card to get data using labview

    i'm still green in this field. can anybody help me on how to get various data from daq card(not an ni brand) using my labview programming. i use labview 6 and i don't know how to get the data so i can display it in my programming. i used Pcl 1800 and pcl 836 card of advantech brand.

    Greetings,
    Below is a link to a KnowledgeBase, which discusses your options:
    http://pong.ni.com/public.nsf/websearch/F3009806E2AE416E8525645D0076B962?OpenDocument
    It appears that Advantech has a LabVIEW driver available. Below is a link to information about the driver on their Web Site. I would suggest trying this option, as opposed to using the Call Library Function with Advantech's driver DLLs:
    http://www.advantech.com/content/0000000175/0000000175.asp?css=corp&name=corp
    Good luck with your application.
    Spencer S.

  • Do i need a web server for using JDBC?

    I read every article about jdbc but i cannot get it working. It looks like everything is good with the program. So the problem is in required components.
    Do i need a web server to get it woking? Or it is enough to have Eclipse, jdbc driver in classpath?
    Tell me about how that url is working.
    For example i have url with localhost. Who is handling that adress? Database? Can you explain what component answers for access to my database through this url parameter. THnx in advance)

    I am using PostgreSQL
    import java.sql.*;
    public class JDBCTest {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
               String url = "jdbc:posgresql://localhost:5432/postgres";
                   Connection con;
                   Statement stmt;
                   try {
                        Class.forName("org.postgresql.Driver");
                   } catch(java.lang.ClassNotFoundException e) {
                        System.err.print("ClassNotFoundException: ");
                        System.err.println(e.getMessage());
                   try {
                        con = DriverManager.getConnection(url,
                                                      "postgres", "1111");
                        stmt = con.createStatement();
                        con.setAutoCommit(false);
                        /*String insertStore1 = "INSERT INTO test1 VALUES (" +
                          "newval,1);";
                        stmt.addBatch(insertStore1)
                        int [] updateCounts = stmt.executeBatch(); */
                     ResultSet rs = stmt.executeQuery("SELECT * FROM test1");
                        System.out.println("Table test1:");
                        while (rs.next()) {
                             int storeNo = rs.getInt("second_column");
                             String first_column = rs.getString("first_column");          
                             System.out.println(storeNo);
                             System.out.println(first_column);
                        rs.close();
                        stmt.close();
                        con.close();
                   } catch(BatchUpdateException b) {
                        System.err.println("-----BatchUpdateException-----");
                        System.err.println("SQLState:  " + b.getSQLState());
                        System.err.println("Message:  " + b.getMessage());
                        System.err.println("Vendor:  " + b.getErrorCode());
                        System.err.print("Update counts:  ");
                        int [] updateCounts = b.getUpdateCounts();
                        for (int i = 0; i < updateCounts.length; i++) {
                             System.err.print(updateCounts[i] + "   ");
                        System.err.println("");
                   } catch(SQLException ex) {
                        System.err.println("SQLException: " + ex.getMessage());
                        System.err.println("SQLState:  " + ex.getSQLState());
                        System.err.println("Message:  " + ex.getMessage());
                        System.err.println("Vendor:  " + ex.getErrorCode());
    }1 ) Also i have installed PostgreSQL 8.2 , and its running in my services as "PostgreSQL Database Server (postmaster)"
    2) I included postgresql-8.2-505.jdbc3.jar into classpasth from eclipse (added it as external library)
    3) I have added tcpip_socket = 1 to postgresql.conf
    4) I have
    # IPv4 local connections:
    host all all 127.0.0.1/32 trust
    host all all localhost/32 trust
    # IPv6 local connections:
    #host all all ::1/128 md5
    in my pg_hba.conf
    ==========================
    Finally
    And i get error: no suitable sql driver
    but i don't get System.err.print("ClassNotFoundException: "); as you can see in my code means my classpath is correct...

Maybe you are looking for

  • How do you return to web page after executing servlet?

    When I submit some values to my servlet from a page, using a from, how do I get back into the web page directory? When you call the servlet, the url turns to "./servlet", and if I click on submit again, it tries to find "./servlet/servlet" so obvious

  • JSF, Tiles, Spring

    Good days people, I take a couple of weeks trying to mount an example in the one that could join myfaces with tiles and spring without too much success. Could you comment on me the people who should have realized this task, which version of jars they

  • Transferring podcasts to iPod from iPad

    Can anyone please explain to me how to transfer my podcasts on my ipad to my iPod.

  • Queries about Zen Stone Plus 2GB with built in speaker .

    Hi , This one goes out to all friends who have?used Zen Stone Plus with built in speaker for some time ... As stated in the box pack of giving a standby time of 20hrs continious playback ... What is the approx backup time it offers or rather it shoul

  • Exception when fetch message from pop3 mail server

    below exception occur whenever i fetched message from pop3 mail server. Its occur for perticular message. so i catched javax.mail.MessagingException but this is not working and rest of the messages skips. plz help me , its urgent. javax.mail.Messagin