How to view images which resides in the database using JFrame.

Hello defts,
Im developing an application using swings. I need to display a image in a JFrame during an button click event. where that image resides in the database.

the image shouldn't be in the db, just the path to the image location.
so, open the db, get the location, close the db, get the image from the location,
then either add the image to the frame via a JLabel or a JPanel (and its paintComponent()).
when you add/remove components to the frame you will need to call
frame.validate();, and possibly also
frame.repaint();

Similar Messages

  • How To display a table that resides in the database via JFrame.

    Hi,
    I need to display the contents that present in the table that resides in my database.
    Scenario:
    Im having Main frame window, in that im having a button, while clicking that button a new JFrame should be opened & it should display all the rows & cols of dat table that resides in my DB.
    I have no prob in opening a new JFrame during a button click, but i dont knw how to display table in the table format.
    I tried JTable but i dont know how to pass the data into the JTable.
    Kindly help me out!!!

    JTable relies on a TableModel to deliver data. You have several ways of providing this data:
    - Read it into either a Vector of Vectors (list of rows containing list of columns) or an Object[][] and create the JTable while passing the data.
    - Create a javax.swing.table.DefaultTableModel, pass it to the JTable as a model, configure it and call addRow() in order to add rows.
    - Create a custom table model class; see javax.swing.table.AbstractTableModel for a convenient base class

  • How To Insert List of Record To the Database Using Linq

    Good day every one, Please i need little help, I have a list of record like this
    lblID.Text = string.Join("<br/>", numbers);
    gives the Numbers below...
    6131
    5241
    3978
    6824
    3842//To Save to the database
    int pin = int.parse(lblID.Text);
    Now i want to insert those Numbers to the database
    Persons ps = new Persons();
    ps.Number = pin;
    cdc.Persons.AddObject(ps);
    cdc.SaveChanges();
    it throws up error...
    what i want to achieve on button insert
    all Numbers will be inserted but before inserting the number it will check if those numbers exist first on the database
    it should be like this on the database
    ID Number
    1 6131
    2 5241
    3 3978
    4 6824
    5 3842
    thanks.. I do appreciate your time and effort

    Hello,
    >>Now i want to insert those Numbers to the database
    For inserting a list of items to database, a loop statement is needed. I do not how you get these numbers, I assume they are stored in a collection and you could check below demo sample to insert these numbers and I assume your person table is identified:
    using (DFDBEntities db = new DFDBEntities())
    List<int> numbers = new List<int>() { 6131, 5241, 3978, 6824, 3842 };
    for (int i = 0; i < numbers.Count; i++)
    int number = numbers[i];
    //Check if the local and database already contains this number
    bool isRecordExist = db.Tables.Any(t => t.Number == number) || db.Tables.Local.Any(t => t.Number == number);
    if (!isRecordExist)
    Table t = new Table();
    t.Number = number;
    db.Tables.Add(t);
    db.SaveChanges();
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to retrieve image in BLOB in oracle database using JSP?

    do any one the method to view image in homepage using jsp from BLOB field in oracle database ?
    thx

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Bon BOn:
    do any one the method to view image in homepage using jsp from BLOB field in oracle database ?
    thx<HR></BLOCKQUOTE>
    I am using a servlet that retrieves the BLOB from the database, sets the MIME type and puts it in a stream. The code is :
    package TestQueryITM;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.OracleDriver;
    import oracle.jdbc.driver.*;
    public class MIMEServlet extends HttpServlet {
    DbConnect myDbBean = new DbConnect();
    int Id=6;
    String MIME ="plain/text";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest req,HttpServletResponse res)
    throws ServletException, IOException
    try
    String content_type = new String();
    String filename = new String();
    // Load the Oracle JDBC driver:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    // Connect to the database:
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@ORAVISION:1521:DEV","[username]", "[password]");
    // It's faster when auto commit is off:
    conn.setAutoCommit (false);
    // Create a Statement:
    Statement stmt = conn.createStatement ();
    try
    BLOB lob_loc = null;
    java.io.InputStream in = null;
    int pos = 0;
    int length = 0;
    OracleResultSet rset = (OracleResultSet) stmt.executeQuery (
    "SELECT text FROM test WHERE ID = "+Id);
    if (rset.next())
    lob_loc = ((OracleResultSet)rset).getBLOB(1);
    MIME=rset.getString(2);
    // File binaryFile = new File("C:/aantekeningen.doc");
    // FileInputStream in = new FileInputStream(binaryFile);
    in = lob_loc.getBinaryStream();
    // This loop fills the buf iteratively, retrieving data // from the InputStream:
    res.setContentType (application/pdf);
    res.setHeader ("Content-Disposition","attachement;filename=test.doc");
    ServletOutputStream op = res.getOutputStream ();
    byte[] buffer = new byte[32000];
    while ((in != null) && ((length = in.read(buffer)) != -1))
    // the data has already been read into buf
    System.out.println("Bytes read in: " +
    Integer.toString(length));
    op.write(buffer,0,length);
    op.flush();
    op.close ();
    in.close();
    stmt.close();
    conn.commit();
    conn.close();
    }catch (SQLException e)
    e.printStackTrace();
    }catch(Exception e)
    System.out.println("<BR>");
    e.printStackTrace();
    System.out.println("<BR>");
    public String getServletInfo() {
    return "TestQueryITM.MIMEServlet Information";
    null

  • How to get first 10 records from the database using JSP

    i want ot get first 10 records from the database and then after clicking the next button in the page,it must show the next precceding 10 records from the database.i am getting the first 10 records .but how to post to the same page to get another preceeding 10 record.

    Search the forums - this has been asked a lot. I usually recommend experimenting with tops and order bys until you're satisfied.
    Kind regards,
      Levi

  • How to change COMPATIBLE parameter while creating the database using DBCA

    I have installed 10.2.01.0 on centos 4.7
    Now i want to create database with COMAPTIBLE parameter 9.2.0.1
    I m trying to create database through DBCA, changed the initialization parameter COMAPTIBLE to 9.2.0.1.
    But gives me error
    ORA-19583: conversation termintated to error
    ORA-19870: error reading backup peice /opt/oracle/assistants/dbca/templates/Seed_Database.dfb
    ORA-00600: internal error code,arguments: [krbrckhr_compressed],[opt/oracle/assistants/dbca/templates/Seed_Database.dfb],[29],[30],[11420],[],[],[]
    ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 5149
    ORA-06512: at line 16
    if i dont change the value of COMPATIBLE parameter then its running perfactly...
    But i have to set compatible parameter as 9.2.0.1....
    Can anybody tell me how to create database using 10g R2- 10.2.0.1.0 with compatible parameter 9.2.0.1

    Thank you for your response.
    I have tried that opting.
    After creating the database with COMAPTIBLE parameter 10.2.0.1.0 changed that parameter in init.ora file to 9.2.0 and start the database.
    But at that time getting
    ORA-00201: contorl file version 10.2.01.0 incompatible with ORACLE version 9.2.0.0
    ORA-00202: control file '/opt/oracle/oradata/ORCL/control01.ctl'

  • How to remove only one row from the database using labview6.1

    using labview 6.1 I create a table with various rows and columns and store bulk of data's in them.,, what procedure should I follow to remove only one paticular row from the database? Help me out with an example please,,
    Thanking you in advance!

    Hi,
    If you have the database toolkit you can delete a row using just a SQL Query to "DB Tools Execute Query.VI"
    Example:
    DELETE FROM Table name Where SerialNum='Value' And Date='Value' And Time='Value'
    See also attached VI
    Best Regards
    Johan
    Attachments:
    Delete_a_row_in_a_database_table.vi ‏48 KB

  • How to view metrics for JVM on the database side

    I am using lob in a stored procedure. I understand that this uses the JVM.
    I would like to know how to easily view the JVM metrics.
    Thanks,
    Charles Li

    I am running a stored procedure that uses getXML. I would like to know how much memory its using up. I was told to increase the java pool, but it did not help with large query of getXML. What should I monitor for getXML?
    Thanks.

  • How to display all tables residing in my database

    i'm using 10g express edition.
    i'm developing a .net application using oracle
    i want display table infomation in a datagrid
    for that i need to select tables fromthe database using the interface given by them
    in that i found server name field.....what it actually means?
    also how to create a new database in 10g and how to display all tables residing in the database?
    pls help me
    thanking u
    chaitanya

    user11359516 wrote:
    i want display table infomation in a datagrid
    select owner||'.'||table_name owner_table_name
      from all_tables   
    user11359516 wrote:in that i found server name field.....what it actually means?i'm not sute what you mean by server name field? if you refer to table column name see this code below:
    select owner||'.'||table_name||'.'||column_name table_column_name,
           decode(data_type,'VARCHAR',data_type||'('||to_char(data_length)||')',
                            'VARCHAR2',data_type||'('||to_char(data_length)||')',
                            'NUMBER',decode(data_scale,0,data_type||'('||to_char(data_precision)||')',
                                                      null,data_type,
                                                      data_type||'('||to_char(data_precision)||','||to_char(data_scale)||')'),
                            data_type) type,
                            nullable
      from all_tab_cols
    order by table_name, column_id

  • How will I know which Scenario is my message using?

    I have a problem figuring which scenario is my message using.  We have this interface which has 2 similar scenarios.  The scenarios are actually the same-everything inside it-the only difference is the scenario name.  How would I know which scenario is the message using? I tried looking into the trace but I cannot find it there.

    Mary,
    As replied in the above posts, U can not create two sender comm channel or receiver determination for same interface from same source. As told, ur objects might have been copied to two scenrios which  you have also confirmed.
    Scenario name can be treated just as a container to hold the objects logically which belong to one process. It doesnt have any role in the execution of ur process.
    You can try to change ur objects in any one scenario & same will be replicatd in other scenario also. So if I m nt wrong, I will conclude that scenario name is jst to combine the objects & doest have ny role in execution of process in XI.
    Regards
    Sushil

  • I am using referenced images, saved on an external hard drive. It would be most helpful to transfer the new captions (version name) to the referenced images which still have the camera code on them. How can this be done? Thanks so much!

    I am using referenced images, saved on an external hard drive. It would be most helpful to transfer the new captions (version name) to the referenced images which still have the camera code on them. How can this be done? Thanks so much!

    You're question is hard to follow. Are you looking to rename your master files to the version name? Or are you looking to do something with IPTC caption field and the masters?

  • Can I see how many views a book had in the iTunes Store?

    Can I see how many views a book had in the iTunes Store?

    No,  but you can  open your iTunesconnect page and see how many downloads and in what countries over a certain period and there are other none Apple application which offer more info....
    Search  posts by K.T. he has given out this infor previously in the iBooks discussion gpoup

  • Adobe Cloud has 2 different Muse programs.... how do I know which one is the newer better version?

    So I am new to Muse, and my Adobe Cloud has 2 different programs from Muse... how do I know which one is the newer better version?
    One Must program (Muse CC 2014.2)  has a black background when working on it... it looks like other Adobe programs such as Photoshop.
    The other one is light color (Muse CC) very similar to the black color Muse on functions.....
    One of the difference I notice is that the light color Muse has a few widgets in the library, while the black background Muse seems to have an empty library
    So... why are there 2 different Muse programs in my Adobe Cloud?

    Hi
    The latest version of Muse is 2014.2, so you need to uninstall another version of Muse manually.
    regarding the items in Library, you can add items in your library manually, as shown in this article
    Adobe Muse Help | Organizing and reusing design elements using Library panel
    Please let me know if you have any other query.

  • How to find out which type of the driver is used in our application?

    Hi all,
    can anyone tell me how to find out which type of the driver is used in our application?
    Thanks in advance,
    Phoeniox

    Hi,
    Check out this...
    Class.forName("com.mysql.jdbc.Driver"); //if u r using MySql
    List drivers = Collections.list(DriverManager.getDrivers());
                   for(int i=0;i<drivers.size();i++)
                        Driver driver = (Driver)drivers.get(i);
                        String driverName = driver.getClass().getName();
                        System.out.println("Driver "+i+":::"+driverName);
    you need to load the driver and display in the same program.
    Then only you'l get the required result.
    prakhyath

  • How to edit bitmap which is imported in flash using xml and save the edited bitmap back to xml in flash.

    hi all
    It would be appreciated if any one let me know how to edit
    bitmap which is imported in flash using xml and save the edited
    bitmap back to xml in flash.
    Is it posible to save the bitmap data in flash?
    thanks in advance

    Yes you can... but like I said before you need to upload the
    data from the changes you make to a server.
    In terms of the solution... its unlikely that you'll find one
    specifically for your needs. You will have to learn whatever you
    don't know how already and maybe adapt some existing examples to
    your needs.
    To change the visual state of a movie clip... you just do all
    the regular things that you want to do to it using flash... scale,
    rotation, drawing API , textfields etc in actionscript. If you
    don't know how to how to do that stuff, then you need to learn that
    first. That's basic actionscript.
    You can capture the visual state of a movieclip using the
    BitmapData class. That includes a loaded jpeg. You can also
    manipulate bimatp data using the same class. You should read up on
    that if you don't know how to use it or check out the examples
    below for uploading info.
    For uploading to the server:
    Here's an as2 solution that took 15 secs to find using
    google:
    http://www.quasimondo.com/archives/000645.php
    If you're using as3, google search for "jpeg encoder as3" and
    look through that info. There are also historical answers in the
    forums here related to this type of thing that might help as
    well.

Maybe you are looking for

  • Propagation disabled with error ORA-25315

    Hi, I setup a stream replication for one schema in my db, but the propagation process suddenly disable with error message "ORA-25315 unsupported configuration for propagation of buffered messages", the schema only use some normal datatypes and I have

  • How to control errors in BPM

    HI all, We are developing a quite complicated BPM. We need to controle errors in File Adapter, just in case the comunication channel cannot write/read (for example with a wrong FTP account). In case of error we need to send an email. So we are trying

  • Can you watch movies with lid closed on Powerbook G4 that's connected to TV

    Hi there, is it possible to have a Powerbook G4 connected to a TV and watch movies with the Powerbook's lid closed.

  • Arabic pdf report

    hi we have uploaded a custom .rdf on the application, when we run this report with output text the arabic is shown fine but when we try to change the output to pdf the arabic is not readable (rubbish), is there a way to show arabic in pdf. we have re

  • Help to write query(urgent)

    Hi There, I have 2 tables ''transaction" with column 'po_num' and ''purchase_order'' with columns 'po_num_id' and 'po_num_name'. columns 'po_num' and 'po_num_name' have some numbers some values in 'po_num_name' are equal to 'po_num' and some values a