Put ViewObject into scope in Java

I need put ViewObject into scope in Java. For example,
<bc4j:findViewObject name="xxxxView"> (FindViewObjectEventHandler) puts "xxxxView" into scope.
Could I do the same in Java:
ApplicationModule am = (ApplicationModule) context.getProperty(JboConstants.BC4J_NAMESPACE,
JboConstants.APP_MODULE_PROPERTY);
ViewObject vo = am.findViewObject("xxxxView");
and then put it into scope?

Sergey -
Usually, the reason for putting a view object into scope (using <bc4j:findViewObject>) is to make the view object available to other declarative event handlers. If you are writing Java code, then once you obtain a reference to your view object, you should be able to interact with it programmatically - without needing to "put it into scope".
Can you tell me a bit more about the behavior that you are trying to implement? I want to get a better understanding of why you need to put the view object into scope... what UIX code is going to be accessing the view object after you have put it into scope? Where is the Java code that puts the view object into scope being called from (an event handler)?
Andy

Similar Messages

  • How to put graphics into a JViewport?

    Hi,
    I'm trying to make a simple game, where a block can move around in a 30x30 grid with collision detection. So far, it works alright, but I want the window to hold only 10x10 and for the block that is moving to stay at the center while the painted background moves around. The program reads a .dat file to get the world.
    So is there a way to use the background world Ive painted and put it into a viewport so that it will scroll when the keys are hit to move? Also I'd like to make the block stay at the center of the screen, unless it's at a corner.
    Hopefully this makes sense and someone can help. Thanks.
    Here's my code:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.io.*;
    public class SmallWorld extends JPanel
                              implements KeyListener,
                                         ActionListener {
         //WORLD
         String[][] worldArray = new String[30][30];
         private static Color redBlock = new Color(255,0,0,255);
         private static Color whiteBlock = new Color(255,255,255,150);
         private static Color blackBlock = new Color(0,0,0,150);
         boolean keyUP = false;
         boolean keyDOWN = false;
         boolean keyLEFT = false;
         boolean keyRIGHT = false;
         //Starting coordinates
         int blockPositionX = 1;
         int blockPositionY = 1;
         JTextField typingArea;
         JViewport viewable;
        public SmallWorld() {
            super( );
              createWorld();     
            typingArea = new JTextField(20);
            typingArea.addKeyListener(this);
              typingArea.setEditable( false );
              add(typingArea);
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
              String type = "";
              for (int i = 0; i < 30; i++) {
                   for (int j = 0; j < 30; j++) {
                        type = worldArray[i][j];
                             if ( type.equals("1") )
                                  g.setColor(redBlock);
                                  g.fillRect( (j * 50),(i * 50),50,50 );
                             else {
                                  g.setColor(whiteBlock);
                                  g.fillRect( (j * 50),(i * 50),50,50 );          
              g.setColor(blackBlock);
              g.fillRect( (blockPositionX * 50),(blockPositionY * 50),50,50 );     
         //Get the world from the DAT file and translate it into a 2d array to be used by paintComponent
         public void createWorld() {
            String getData = null;
              int countRow = 0;
            try {
                   FileReader fr = new FileReader("world.dat");
                   BufferedReader br = new BufferedReader(fr);
                   getData = new String();
                   while ((getData = br.readLine()) != null) {
                  if(countRow < 30) {
                        for (int i = 0; i < 30; i++) {
                             String temp = "" + getData.charAt(i);
                             worldArray[countRow] = temp;
                        countRow++;
    } catch (IOException e) {
    // catch possible io errors from readLine()
    System.out.println("Uh oh, got an IOException error!");
    e.printStackTrace();
         //Move Block around the world
         public void moveBlock() {
              Graphics g = this.getGraphics();
              Point pt = new Point();
              pt.x = blockPositionX * 50;
              pt.y = blockPositionY * 50;
              if (keyUP) {
                   g.setColor(blackBlock);
              g.fillRect( (blockPositionX * 50),(blockPositionY * 50),50,50 );
              if (keyDOWN) {
                   g.setColor(blackBlock);
              g.fillRect( (blockPositionX * 50),(blockPositionY * 50),50,50 );
              if (keyLEFT) {
                   g.setColor(blackBlock);
              g.fillRect( (blockPositionX * 50),(blockPositionY * 50),50,50 );
              if (keyRIGHT) {
                   g.setColor(blackBlock);
              g.fillRect( (blockPositionX * 50),(blockPositionY * 50),50,50 );
         //check for collisions with blocks
         public boolean checkCollision(int row, int col) {
              if ( worldArray[col][row].equals("1") ) {
                   return true;
              else {
                   return false;
    //If key typed, put action here. none for now
    public void keyTyped(KeyEvent e) {
    /** Handle the key pressed event from the text field. */
    public void keyPressed(KeyEvent e) {
    updateView( e );
    //If key released, put action here. none for now
    public void keyReleased(KeyEvent e) {
    /** Handle the button click. */
    public void actionPerformed(ActionEvent e) {
         //Update the view of the window based on which button is pressed
         protected void updateView( KeyEvent e ) {
              //if UP is pressed
              if ( e.getKeyCode() == 38 ) {
                   keyUP = true;
                   if ( checkCollision( blockPositionX, blockPositionY - 1 ) == false ) {
                        blockPositionY = blockPositionY - 1;
                        this.repaint();
                        moveBlock();
                   keyUP = false;
              //if DOWN is pressed
              if ( e.getKeyCode() == 40 ) {
                   keyDOWN = true;
                   if ( checkCollision( blockPositionX, blockPositionY + 1 ) == false ) {
                        blockPositionY = blockPositionY + 1;
                        this.repaint();
                        moveBlock();
                   keyDOWN = false;
              //if LEFT is pressed
              if ( e.getKeyCode() == 37 ) {
                   keyLEFT = true;
                   if ( checkCollision( blockPositionX - 1, blockPositionY ) == false ) {
                        blockPositionX = blockPositionX - 1;
                        this.repaint();
                        moveBlock();
                   keyLEFT = false;
              //if RIGHT is pressed
              if ( e.getKeyCode() == 39 ) {
                   keyRIGHT = true;
                   if ( checkCollision( blockPositionX + 1, blockPositionY ) == false ) {
                        blockPositionX = blockPositionX + 1;
                        this.repaint();
                        moveBlock();
                   keyRIGHT = false;
    * Create the GUI and show it. For thread safety,
    * this method should be invoked from the
    * event-dispatching thread.
    private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("SmallWorld");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    JComponent newContentPane = new SmallWorld();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
         frame.setSize(500,520);
    frame.setVisible(true);
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    The world DAT file:
    111111111111111111111111111111
    100010001010001000101000100011
    100010001010001000101000100011
    100011101010000000001000000001
    100010000010000000001000000001
    100110000010000000001000000001
    100000000010000000001000000001
    111100011110000000001000000001
    100000000110001110111000111011
    100000000000001110111000111011
    100000000000000000001000000001
    100010001110000000000000000001
    100010001110001110111000111011
    100011101100000000000000000011
    100010000110001110111000111011
    100110000100000000000000000011
    100000000110000000001000000001
    111100011100000000000000000011
    100000000100000000000000000011
    100000000010000000000000000001
    100000000010000000000000000001
    100010000000000000000000000001
    100010000000001110111000111011
    100011101110000000011000000001
    100010000110000000011000000001
    100110000110000000001000000001
    100000000110001110111000111011
    111100011110000000011000000001
    100000000110000000011000000001
    100000000011111111111111111111

    I know this is an old posting, but I just saw another question similiar to this and I still have my old code lying around that incorporates most of the suggestions made in this posting. So I thought I'd post my code here in case anybody wants to copy/paste the code. You will still need to use the DAT file provide above as well as provide icons to represent the floor and wall.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class SmallWorld extends JPanel implements KeyListener, ActionListener
         //WORLD
         String[][] worldArray = new String[30][30];
         //Block colors
         private static Color redBlock = new Color(255,0,0,255);
         private static Color whiteBlock = new Color(255,255,255,255);
         private static Color blackBlock = new Color(0,0,0,150);
         //World images
    //     JLabel wall = new JLabel( new ImageIcon("wall.gif") );
    //     JLabel floor = new JLabel( new ImageIcon("floor.gif") );
         ImageIcon wallIcon = new ImageIcon("dukewavered.gif");
         ImageIcon floorIcon = new ImageIcon("copy16.gif");
         //Starting coordinates
         int blockPositionX = 1;
         int blockPositionY = 1;
         //Typing area to capture keyEvent
         JTextField typingArea;
         //Viewable area
         JViewport viewable;
         String type = "";
         JLayeredPane layeredPane;
         JPanel worldBack;
         JPanel panel;
         JPanel player;
         Dimension worldSize = new Dimension(1500, 1500);
         public SmallWorld() {
              super( );
              createWorld();
              layeredPane = new JLayeredPane();
              add(layeredPane);
              layeredPane.setPreferredSize( worldSize );
              worldBack = new JPanel();
              layeredPane.add(worldBack, JLayeredPane.DEFAULT_LAYER);
              worldBack.setLayout( new GridLayout(30, 30) );
              worldBack.setPreferredSize( worldSize );
              worldBack.setBounds(0, 0, worldSize.width, worldSize.height);
              worldBack.setBackground( whiteBlock );
              for (int i = 0; i < 30; i++) {
                   for (int j = 0; j < 30; j++) {
                        JPanel square = new JPanel( new BorderLayout() );
                        worldBack.add( square );
                        type = worldArray[i][j];
                        if ( type.equals("1") )
                             square.add( new JLabel(wallIcon) );
                        else
                             square.add( new JLabel(floorIcon) );
              //Draw the player
              player = new JPanel();
              player.setBounds(50, 50, 50, 50);
              player.setBackground( Color.black );
              player.setLocation(50, 50);
              layeredPane.add(player, JLayeredPane.DRAG_LAYER);
              //set where the player starts
    //          panel = (JPanel)worldBack.getComponent( 31 );
    //          panel.add( player );
              //Create the typing area with keyListener, add to window
              typingArea = new JTextField(20);
              typingArea.addKeyListener(this);
              typingArea.setEditable( false );
              add(typingArea);
         //Get the world from the DAT file and translate it into
         //a 2d array to be used by paintComponent
         public void createWorld() {
              String getData = null;
              int countRow = 0;
              try {
                   //Get file
                   FileReader fr = new FileReader("world.dat");
                   BufferedReader br = new BufferedReader(fr);
                   getData = new String();
                   //read each line from file, store to 2d array
                   while ((getData = br.readLine()) != null) {
                        if(countRow < 30) {
                             for (int i = 0; i < 30; i++) {
                                  String temp = "" + getData.charAt(i);
                                  worldArray[countRow] = temp;
                        countRow++;
              } catch (IOException e) {
              System.out.println("Uh oh, got an IOException error!");
              e.printStackTrace();
         //Move Block around the world
         public void moveBlock() {
              Point pt = new Point();
              pt.x = blockPositionX * 50;
              pt.y = blockPositionY * 50;
              int x = Math.max(0, pt.x - 250);
              int y = Math.max(0, pt.y - 250);
              Rectangle r = new Rectangle(x, y, 550, 550);
              scrollRectToVisible( r );
         //check for collisions with blocks
         public boolean checkCollision(int row, int col) {
              if ( worldArray[col][row].equals("1") ) {
                   return true;
              else {
                   return false;
         public void keyTyped(KeyEvent e) {
         public void keyPressed(KeyEvent e) {
              updateView( e );
              e.consume();
         public void keyReleased(KeyEvent e) {
         public void actionPerformed(ActionEvent e) {
         //Update the view of the window based on which button is pressed
         protected void updateView( KeyEvent e ) {
              //if UP
              if ( e.getKeyCode() == 38 ) {
                   if ( checkCollision( blockPositionX, blockPositionY - 1 ) == false ) {
                        blockPositionY = blockPositionY - 1;
                        moveBlock();
                        player.setLocation(blockPositionX *50, blockPositionY*50);
              //if DOWN
              if ( e.getKeyCode() == 40 ) {
                   if ( checkCollision( blockPositionX, blockPositionY + 1 ) == false ) {
                        blockPositionY = blockPositionY + 1;
                        moveBlock();
                        player.setLocation(blockPositionX *50, blockPositionY*50);
              //if LEFT
              if ( e.getKeyCode() == 37 ) {
                   if ( checkCollision( blockPositionX - 1, blockPositionY ) == false ) {
                        blockPositionX = blockPositionX - 1;
                        moveBlock();
                        player.setLocation(blockPositionX *50, blockPositionY*50);
              //if RIGHT
              if ( e.getKeyCode() == 39 ) {
                   if ( checkCollision( blockPositionX + 1, blockPositionY ) == false ) {
                        blockPositionX = blockPositionX + 1;
                        moveBlock();
                        player.setLocation(blockPositionX *50, blockPositionY*50);
         private static void createAndShowGUI() {
              JFrame frame = new JFrame("SmallWorld");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JComponent newContentPane = new SmallWorld();
              newContentPane.setPreferredSize( new Dimension(1500, 1500) );
              JScrollPane scrollPane = new JScrollPane( newContentPane );
              scrollPane.setPreferredSize( new Dimension(568, 568) );
              frame.getContentPane().add( scrollPane );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setResizable( false );
              //frame.setSize(500,520);
              frame.setVisible( true );
         public static void main(String[] args) {
              javax.swing.SwingUtilities.invokeLater( new Runnable() {
                   public void run() {
                        createAndShowGUI();

  • REP-1425 report formula DO_SQL error putting value into column

    Hi all
    I have opened a report 2.5 in Oracle9i Reports Developer and, it converted ok. However, when I run the report (paper layout), the message
    rep-1425 report formula DO_SQL error putting value
    into column. Column may not be referenced by parameter
    triggers
    appears. There are several report level formula columns and corresponding placeholder columns that are the cause of this error. The formula has the following :
    SRW.DO_SQL('SELECT RPAD(''DAILY TABLE AUDIT REPORT'',60,''.'')||TO_CHAR(SYSDATE,''DD-MON-YYYY'') INTO :REPORT_TIT FROM DUAL');
    COMMIT;
    RETURN('');
    I can't work out what this error message really means as the column, report_tit is a placeholder column and, the formula column is not a parameter trigger!! The report_tit placeholder is used as a source for a layout field. I noticed that the layout field is defined as a placeholder column in the converted report but in the reports 2.5 version, it is defined as a layout field.
    I can do a work around by replacing the SRW.DO_SQL statement with a normal PL/SQL SELECT statement. However, I wonder if anyone else has had the same problem and, if anyone can help provide an answer as to what this error really means and, also, how I can retain the SRW.DO_SQL statement and/or an alternative work around to the one that I have described.
    Thanks.
    Therese Hughes
    Forest Products Commision

    Hi again
    The firewall proved to be the problem after all! The firewall set in Reports config-files is not used for WebServices, it has to be set within the stub:
    Properties prop = System.getProperties();
    prop.put("http.proxyHost","yourProxyServer");
    prop.put("http.proxyPort","youProxyServerPort");
    I inserted this in my java-code and after some problems (see below), restarting Report Builder turned the trick, the report works now.
    Cheers
    Tino
    Here there mail I set up before I found that restarting Report Builder helped:
    Thanks for your answer, putting in the proxy-settings actually helped some - the same error message is
    popping up, but instantly and not after 10 seconds like before:
    My proxy lines look like this, I also tried "http://proxy.ch.oracle.com", but "proxy.ch.oracle.com" proved to
    be the correct syntax:
    public Float getRate(String country1, String country2) throws Exception
    Float returnVal = null;
    Properties prop = System.getProperties();
    prop.put("http.proxyHost","proxy.ch.oracle.com");
    prop.put("http.proxyPort","8080");
    URL endpointURL = new URL(endpoint);
    Call call = new Call();
    I tested the new proxy-entries by disabling the proxy preference in JDeveloper, so I could verify the added
    proxy-lines in the code work - they do. If I change the proxy to some incorrect value like
    "proxyy.ch.oracle.com", they fail.
    After unsuccessfully trying recompile and re-import of Java classes, I rebuild the report from scratch and
    stumbled over the same problem. Now the question is, whether I'm still doing something wrong with the
    proxy or whether there is another problem after passing the firewall....
    -------------------------------------------------------------------------------------------------------------

  • In general, how do I put code into a loop?

    I have access to a procedure that takes a parameter and spits out a single result. I need to figure out how to use that procedure and spit out many results. This example should clear things up.
    VARIABLE enum NUMBER;
    EXEC :enum := 7566;
    -- my procedure. Cannot change code here.
    -- Prints out a formatted name and job, given an empno stored in :enum
    SELECT ename || ' (' || job || ')' AS "myrow"
    FROM scott.emp
    WHERE empno = :enum;
    -- end of my procedureHere, I can't change anything from the SELECT to the semi-colon. Now I would like to put this into a PL/SQL LOOP, but I can't figure it out. Let's say I want to print out all of the employees with a job of manager. Somehow I will need enum to take the value of the current iteration from within the loop.
    something like this:
    BEGIN
    -- first get the list of employees
    CURSOR e_cur IS
    SELECT empno
    FROM scott.emp
    WHERE job="MANAGER';
    END;
    BEGIN
    FOR r_cur IN e_cur LOOP
    :enum = r_cur.empno
    -- my procedure. Cannot change code here.
    -- Prints out a formatted name and job, given an empno stored in :enum
    SELECT ename || ' (' || job || ')' AS "myrow"
    FROM scott.emp
    WHERE empno = :enum;
    -- end of my procedure
    END LOOP;
    END;
    {code}
    of course, this code does not work, and I don't know what else to try.
    Thanks in advance for any help!
    Skip                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Oh boy, do I owe you guys an apology. Absolutely no excuse, but I screwed up big time yesterday. I am working on a couple of projects and got some wires crossed. I would like to start over. Forget everything I asked yesterday. I wouldn't be surprised if no one answered, but I could still use some help. I am embarrassed because I am usually pretty good at these things, and again, I humbly apologize.
    Still with me? Here we go:
    I have a SQL script that is quite long. It has 25 select statements, 4 unions, 7 minus'es, lots of joins, sub-queries, etc. The script expects two bind variables to be set before running. The code was written to execute once (like a report). But the code does exactly what I need, but I need to run it on a much larger set. So I would like to wrap it in a loop. Now, I am pretty good at other programming languages (I know, hard to believe given yesterday's exchange). If I have some java code that I want to wrap in a FOR-NEXT loop, often all I need to do is put one line at the top of the code and one line at the bottom. Then I make sure the variables that need t be updated through each iteration are properly updated. Bada-bing, bada-boom, it's done.
    It doesn't seem as easy here. I know that I will have to convert my SQL script to PL/SQL. But I am wrestling with the DECLAREs, BEGINs and LOOPs, and changes to the existing code to ensure the bind variables are updated each iteration. I have tried all of what I thought would be the simple solutions as I described with my java example above, but it has not worked. So, as my subject line indicates, I was wondering if there was a general methodology to LOOP-ifying existing code. I know this is a pretty nebulous question, and I probably blew it yesterday, but I really do need some help. Even if it is "read this and that website/book/etc". That's really it. sigh All that stuff yesterday about "unmodifiable code"--forget about that. I should never have said that. Anything goes.
    Maybe there isn't a simple solution here. SQL isn't Java. And that's OK. At least then I will know I will need to look for a different solution or I will have to get a LOT smarter with SQL and PL/SQL. I thought my super-simple example yesterday was a good enough substitute for what I am faced with, but maybe that isn't a good assumption.

  • Reading .txt files and put it into a TextArea

    Hi all,
    I got a problem! I have to make something like a messenger.
    I want to put the written text into a .txt file, after that I have to get the text out of the .txt file and put in into a TextArea.
    I would ike it to to that like this:
    ">User 1
    Hello!
    >User 2
    Hi!
    Now here are my questions:
    1: What is the moet easy way to do this ?
    2: How could i put Enters into a .txt file with Java ?
    3: How could i read all the text from the .txt file and put it into a TextArea WITH ENTERS ?
    Thanks for your help!
    Greetings, Jasper Kouwenberg

    use JTextArea.read(new FileReader(fileName)) for reading.
    and JTextArea.write(new FileWriter(fileName)) for writing.
    The enters should be ok if the user press enter and adds a new line ("\n") to the text area component.
    It will save the enter in the text file and load it correctly back to the text area.
    If you want to add enter programmatically just add "\n" string to the text area component.

  • Putting message into send queue failed

    Putting message into send queue failed, due to: com.sap.engine.interfaces.messaging.api.exception.DuplicateMessageException: Message Id 8fd8ebf2-14dc-498c-26d4-fa83a612df8f(OUTBOUND) already exists in duplicate check table: com.sap.sql.DuplicateKeyException: Violation of PRIMARY KEY constraint 'PK__BC_MSG_DUP_CHECK__0CB1C3F7'. Cannot insert duplicate key in object 'SAPPIQDB.BC_MSG_DUP_CHECK'..
    I get the above error for one of my interface.
    The scenario is simple lift and shift using integrated scenario.
    I am unable to figure out reason for the above error.
    Regards,
    Lalit Mohan Gupta.

    Hi Lalit Mohan Gupta,
    It seems like you have a problem with duplicate Message IDs (GUID). This can happen if you do not let SAP PI generate the message ID for the message being processed, but is relying on an external system to provide you with the message ID.
    In any case. I don't think you will succeed with getting the message processed, because of the duplicate message ID constraint in SAP PI. But you need to be aware that depending on how your SAP PI has been setup to handle archiving/deletion of messages in Java-stack, you could potentially run into the situation, where SAP PI removes the initial message from its database and by that enables processing of the duplicate message ID.
    Best regards,
    Jacob

  • Now, i can put blob into file, but ...............

    Hi
    At first, Thanks Lawrence Guros , from his hint, i did it(put blob into file) using JDBC.
    In addition i find that, using sql*loader "load" a file(150Mb) into database ,need 3 minutes . Using jdbc "take out" the same file ,need 1.5 minutes. Does jdbc is better than sql*loader ?
    So that i tried to load a file using jdbc, i got a problem.......
    My environment:windows 2000pro,JBuilder 5.0 enterprise,oracle 8.1.6,(not install oracle jdbc driver )
    a part of program(my program is very uglily,if anyone want,later i paste it ba....~_~)
    // Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Statement stmt2=null;
    // Resultset rs2;
    //opa1 is the blob data
    void saveBlobTableToDisk(Connection con) {
    try {
    stmt2=con.createStatement();
    sqlStr2="SELECT * FROM emp3 where id=1004";
    rs2=stmt2.executeQuery(sqlStr2);
    while (rs2.next()) {
    Blob aBlob=rs2.getBlob("opa1");
    i got the exception :
    " null
    java.lang.UnsupportedOperationException
         at sun.jdbc.odbc.JdbcOdbcResultSet.getBlob(JdbcOdbcResultSet.java:4174)
         at test3.Frame1.saveBlobTableToDisk(Frame1.java:48)
         at test3.Frame1.<init>(Frame1.java:26)
         at test3.Application1.<init>(Application1.java:5)
         at test3.Application1.main(Application1.java:8) "
    and the windows pop up a messagebox said that(about) my memory "0x09af007f" could not read, error in javaw.exe .
    Later i used (ResultSet)getBinaryStream() to solve it. but getBinaryStream() only return a InputStream,so that i can make blob to a file,but i can't make a file to blob using jdbc.....
    I am very stupid that installing sun java, oracle jdbc driver etc....(because i must set a lot of thing such as classpath,java_home etc), Can i only use JBuilder to do that ?
    Or i must install oracle jdbc driver ?
    Thanks.
    D.T.

    I would think that SQl*Loader would be faster, but you may want to ask in the SQL*Loader forum for more expert advice.
    I can't tell from your code what you are doing. Is the "opa1" column a image folumn or a straight blob? Which line is 48?
    I only have experience with the oracle JDBC driver. You should be able to use it with jBuilder.
    there is an example of loading an image into an ordimage type at:
    http://otn.oracle.com/training/products/intermedia/media_dev_kit/java_samples_readme.html
    and a more extensive web based photo album:
    http://otn.oracle.com/sample_code/products/intermedia/htdocs/intermedia_servlet_jsp_samples/imedia_servlet_jsp_readme.htm
    And for bulk loading:
    http://otn.oracle.com/sample_code/products/intermedia/htdocs/avi_bulk_loading.html

  • Putting items into hashmap and treemap

    Hi all, this is my first time posting here, I tried doing a search but i didn't find what i was looking for so i hope someone out there and help me out~
    Anyways, my question is that howcome when I am putting entries into either of these maps, the times for entry acutally gets faster as more entries are entered??
    For instance, in my hashMap, it took approximately 8 seconds to enter 1447 entries, but when i am entering in 23042 entries, it takes just a bit over 1 second?
    Does it have soemthing to do with how the methods in hashMap takes on constant time (O(1)) ?
    the same thing happens for HashMap, but the time cost is (O(log n)) for putting entries so i am not sure how to explain this..
    I hope someone understands my question, thanks in advance!

    8 seconds for 1400 entries sounds VERY long.
    In any case, earlier chunks may take longer due to VM startup or hotspot warmup overhead. Resizing the backing store, GC, VM acquiring more memory, OS giving CPU time to other proesses, etc., could all throw off your timing.
    I got the following results:
    HashMap:
    first 350,000: 1 s
    next 300,000: 1 s
    next 250,000: 1 s
    TreeMap:
    First 100,000: 1 s
    Next 50,000: 3 s
    Next 100, 000: 2 s
    Next 50,000: 1 s
    Next 50,000: 1 s
    and so on--generally 1 or 2 seconds per 50,000
    import java.util.*;
    public class MapTiming {
      public static void main(String[] args) throws Exception {
        Map<Integer, Integer> hm = new HashMap<Integer, Integer>();
        Map<Integer, Integer> tm = new TreeMap<Integer, Integer>();
        long start;
        start = System.currentTimeMillis();
        for (int ix = 1; ix <= 1000000; ix++) {
          hm.put(ix, ix);
          if (ix % 50000 == 0) {
            long end = System.currentTimeMillis();
            System.out.println("HashMap " + ix + ": " + ((end - start) / 1000) + " sec.");
        start = System.currentTimeMillis();
        for (int ix = 1; ix <= 1000000; ix++) {
          hm.put(ix, ix);
          if (ix % 50000 == 0) {
            long end = System.currentTimeMillis();
            System.out.println("TreeMap " + ix + ": " + ((end - start)/ 1000)+ " sec.");
    :; java -cp classes MapTiming
    HashMap 50000: 0 sec.
    HashMap 100000: 0 sec.
    HashMap 150000: 0 sec.
    HashMap 200000: 0 sec.
    HashMap 250000: 0 sec.
    HashMap 300000: 0 sec.
    HashMap 350000: 1 sec.
    HashMap 400000: 1 sec.
    HashMap 450000: 1 sec.
    HashMap 500000: 1 sec.
    HashMap 550000: 1 sec.
    HashMap 600000: 1 sec.
    HashMap 650000: 2 sec.
    HashMap 700000: 2 sec.
    HashMap 750000: 2 sec.
    HashMap 800000: 2 sec.
    HashMap 850000: 2 sec.
    HashMap 900000: 3 sec.
    HashMap 950000: 3 sec.
    HashMap 1000000: 3 sec.
    TreeMap 50000: 0 sec.
    TreeMap 100000: 1 sec.
    TreeMap 150000: 4 sec.
    TreeMap 200000: 4 sec.
    TreeMap 250000: 6 sec.
    TreeMap 300000: 7 sec.
    TreeMap 350000: 8 sec.
    TreeMap 400000: 11 sec.
    TreeMap 450000: 12 sec.
    TreeMap 500000: 14 sec.
    TreeMap 550000: 14 sec.
    TreeMap 600000: 16 sec.
    TreeMap 650000: 18 sec.
    TreeMap 700000: 19 sec.
    TreeMap 750000: 21 sec.
    TreeMap 800000: 22 sec.
    TreeMap 850000: 25 sec.
    TreeMap 900000: 25 sec.
    TreeMap 950000: 26 sec.
    TreeMap 1000000: 29 sec.

  • Making a jframe that i can put input into....

    hey guys i was wondering if i could have a very easy beginer code sample ofr making a small jframe that i can put input into....and can we display our own home written code on the forums i checks the conduct thingy but it didnt say...tyvm for the help
    System.out.println("JAVA FOR LIFE!!!");

    [http://java.sun.com/docs/books/tutorial/uiswing/index.html]

  • How to put data into textbox using JSP

    How can I put data into a textbox using JSP?
    This code prints to a html page but I want it inside an text area:
    // Print out the type and file name of each row.
            while(ftplrs.next())
                int type = ftplrs.getType();
                if(type == FtpListResult.DIRECTORY)
                    out.print("DIR\t");
                else if(type == FtpListResult.FILE)
                    out.print("FILE\t");
                else if(type == FtpListResult.LINK)
                    out.print("LINK\t");
                else if(type == FtpListResult.OTHERS)
                    out.print("OTHER\t");
                out.print(ftplrs.getName() +"<br>");
            }I have tried with the code below:
    <textarea name="showDirectoryContent" rows="10" cols="70">
    <%
           // Print out the type and file name of each row.
            while(ftplrs.next())
                int type = ftplrs.getType();
                if(type == FtpListResult.DIRECTORY)
    %>
                    <%= "DIR\t" %>
    <%            else if(type == FtpListResult.FILE) %>
                    <%= "FILE\t" %>
    <%            else if(type == FtpListResult.LINK)  %>
                    <%= "LINK\t" %>
    <%            else if(type == FtpListResult.OTHERS) %>
                    <%= "OTHER\t" %>
    <%            String temp = ftplrs.getName() +"<br>");
                  <%= temp > <br>
    %>
    </textarea>I get the following error:
    Location: /myJSPs/jsp/grid-portal-project/processviewfiles_dir.jsp
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile Note: sun.tools.javac.Main has been deprecated.
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\processviewfiles_dir_3.java:151: 'else' without 'if'.
    else if(type == FtpListResult.FILE)
    ^
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\processviewfiles_dir_3.java:165: 'else' without 'if'.
    else if(type == FtpListResult.LINK)
    ^
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\processviewfiles_dir_3.java:179: 'else' without 'if'.
    else if(type == FtpListResult.OTHERS)
    ^
    C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\processviewfiles_dir_3.java:193: ';' expected.
    String temp = ftplrs.getName() +"");
    ^
    4 errors, 1 warning
         at org.apache.tomcat.facade.JasperLiaison.javac(JspInterceptor.java:898)
         at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:733)
         at org.apache.tomcat.facade.JspInterceptor.requestMap(JspInterceptor.java:506)
         at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java:968)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:875)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:536)
    Please help???

    Yes indeed this works:
    <textarea name="showDirectoryContent" rows="10" cols="70">
    <%
           // Print out the type and file name of each row.
            while(ftplrs.next())
                int type = ftplrs.getType();
                if(type == FtpListResult.DIRECTORY)
    {%>
                    <%= "DIR\t" %>
    <%}            else if(type == FtpListResult.FILE)  {%>
                    <%= "FILE\t" %>
    <%}            else if(type == FtpListResult.LINK)  {%>
                    <%= "LINK\t" %>
    <%}            else if(type == FtpListResult.OTHERS) %>
                    <%= "OTHER\t" %>            
                  <%= ftplrs.getName() %>
    <%
    %>

  • Put Linkedlist into arraylist ???

    hello,
    i have a linkedlist of objects of size 1000. Every object(every node of linked list is an instance of a class) in linkedlist contains of 20 variables. Now i want to take objects from this linkedlist and put it into array list.???
    Example: If User says me i want to see linked list between range 30 to 200. So i want to take get object 30 to object 200 from linkedlist. I have decided to put into an array and pass it to my other class which would perform some calculation on these objects. I am unable to get objects from linkedlist and put into array list.

    import java.util.*;
    public class ListConvert {
        public static void main(String[] args) {
         LinkedList<String> ll = new LinkedList<String>();
         ll.add("test");
         ArrayList<String> al = new ArrayList<String>(ll);
         System.out.println(al.get(0));
    }

  • How do I put text into an Edge File that clients can edit easily afterwards

    Hi
    Can anyone explain how I can put text into an edge file (styled with google fonts) and make it so that clients can access the text and update the text as they require?
    Previous suggestion was dynamically loading a .txt file - any instructions would be most appreciated.
    Thanks.

    Hi Resdesign!
    Your code is very useful to learn how to use Json in Adobe Edge Animate!
    But I have a question: why you use ( i ) as argument of the function UpdateInfo and when you recall it you use ( index )?
    $.getJSON('slides.json', function(data){
              //for(var i=0; i<data.length; i++){
    function updateInfo(i){
                        sym.$("photo").css({"background-image": "url('"+data[i].image+"')"});
                        sym.$("pillar").html(data[i].pillar);
                        sym.$("what").html(data[i].what);
                        // position
              index = -1;
              sym.$("btn").click(function(){
              index++;
                        if (index>=5){
                                  index = 0;
              updateInfo(index);
    Many thanks for your attention!
    Davide

  • I am trying to put music into my 3rd gen ipod touch and older ipod shuffle but they do not show up on Itunes when i connect them,what could be the problem?

    i am trying to put music into my 3rd gen ipod touch and older ipod shuffle but neither are popping up on itunes, what could be the problem?

    See
    iOS: Device not recognized in iTunes for Windows
    - I would start with
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    or              
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    However, after your remove the Apple software components also remove the iCloud Control Panel via Windows Programs and Features app in the Window Control Panel. Then reinstall all the Apple software components
    - New cable and different USB port
    - Run this and see if the results help with determine the cause
    iTunes for Windows: Device Sync Tests
    Also see:
    iPod not recognised by windows iTunes
    Troubleshooting issues with iTunes for Windows updates
    - Try on another computer to help determine if computer or iPod problem

  • My iPhone 4 will NOT show up on iTunes, not even by putting it into recovery mode. Can anyone help me fix this problem? I would like to use iTunes with it.

    I got an iPhone 4 on Thursday.
    I connected it to my PC, a Windows Vista, that day and nothing showed up besides a "camera."
    My computer picked it up as a camera, which I understand is a common occurence in the iPhone.
    After browsing countless youtube videos and Apple Forum Questions, nothing helped.
    I put it into recovery mode by holding on the power and menu button, but when I opened iTunes it still didn't detect anything.
    I feel like I'm almost hurting my iPhone because I turned it off and on so many times, and plugged it in and out several times, and so forth.
    Here is what happened after putting it into recovery mode: 1. A Windows "device locator" popped up. 2. It was looking for a solution to help me with the unknown device, or iPhone. 3. I clicked onto the find solution button, and it told me that I needed a disc.
    --- I didn't have a disc, so I looked up this problem and it told me to manually find Apple mobile device support on my driver, so I did.---
    4. I then went onto Control Panel and clicked on SYSTEM and MAINTENANCE and went to DEVICE MANAGER.
    5. There I found my iPhone listed under USB controllers.
    6. I uninstalled and installed it several times.
    7. I then manually found a program to ease the problem. The program was "apple mobile device support," which was located on my apple driver.
    8. Nothing happened, besides it reporting to me that Apple USB was found and that "code 39" or "code 1" was in the way.
    9. I didn't know what to do with this....
    By this time, I was about to give up on my iPhone and return it back to the store.
    I tried again, but in a different way this time.
    1. I put it back into recovery mode and I opened itunes.
    2. itunes reported to me that some burning or CD/Drive software was missing and that I needed to reinstall it.
    3. SO, I reinstalled it several times, about 12 (iTunes), and nothing changed.
    4. I then looked up the problem of why the CD/Drive software problem kept popping up.
    5. I fixed it by going to my registry and adding an UpperFilter with the code GEARaspi...something like that.
    6. The problem was fixed, but still no iPhone onto my itunes.
    I stayed up all night last night to fix this problem...I'm annoyed and tired.
    I tried another problem to fix this.
    1. I didn't put it into recovery mode.
    2. My iPhone showed up under portable devices under "device manager," from SYS/MAIN"
    3. I did update software.
    4. I clicked on "apple mobile device support" but nothing happened.
    5. It reported to me of the Code thing again.
    I even called the Apple people and they didn't know what to do, so I stopped calling them...because they only had limited options to fix the problem.
    Can anyone help me?

    There's a whole lot to read in your post, and frankly I have not read it all.
    Having said that, this troubleshooting guide should help:
    http://support.apple.com/kb/TS1538
    In particular, pay attention to the mobile device support sections near the bottom, assuming you have already done the items above it.

  • How do I get the pictures folders in photoshop 7 out of My window XP computer and put them into my new computer windows 8 photoshop12

    How do I get the pictures folders in photoshop 7 out of My window XP computer and put them into my new computer windows 8 photoshop12

    I am so sorry for you and your situation. Were you using iCloud photostream?
    Otherwise I do not see any chance for your precious photos.
    Congrats anyway on the little darling!

Maybe you are looking for

  • Where is split cell in the new 2013 pages 5.0?

    What ever happened to the split cell funstion on pages 5.0? Please help me or i will have to request a refund and use Ms Word.

  • Can't drag disc to trash to eject

    Everyhing seems to be working well with Mavericks except that I can no longer drag a disc to the trash to eject it. I have to quit the app I'm using (Toast, iTunes etc) and then open Disk Utility and select the drive to eject from.

  • Calling Stored Procedure from APEX window

    Hopefully someone will be able to help me. I have a stored procedure that generates a csv of time worked from our system. When I hard code the values in the procedure and call it from a button, the popup window opens excel and displays the time worke

  • Question for jschell

    Hi Jschell, I have gone through a lot of posts on jdbc drivers and obviously a lot of them contain your replies. I have a question about JDBC-ODBC bridge and I think you are the right person to answer it with your experience. My project architecture

  • Problems accessing the internet via wifi

    I'm not able to access internet via wifi but am connected to my wifi network. No problems when using 3G I guess it is a dns problem? when i check the wifi settings IP address and subnet mask have details but is blank for router, dns and search domain