Help with displaying info from database+asp

How can I display info from a database so that it is
formatted into rows in a table
here is an example of what I would like
http://www.westerveltcollege.com/new/programs/bus_admin_computers.html
(it is the section that show the course content)
I know it has been code into the table but how to do this
dymanically
hope that makes sense to someone ;)

To do it properly you would set up two tables. The first
would contain the
topics and be something like this
topicID
topicName
Then you would have a second table that would hold the
content like this
contentID
contentName
topicID
The last field links this table to the topic.
To display them you would link the topics into a master list,
and then pass
the topicID to the page displaying the content and use the
topicID as a
filter on the content table.
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"jnc1965" <[email protected]> wrote in
message
news:eeot1q$db0$[email protected]..
> nice one thanks
>
> now one more quetion
> how do I set up the info in the database
> I have serveral page for different topics and each page
has a table like
> mentioned above
> I dont want to make a different colunm for each for the
course contents
> I would like to build one table and have each subject's
course content in
> a
> column but how would I do this?
> and still have appear like the example
>

Similar Messages

  • Help with Retrieve attributes from database

    Hi,
    I'm using filter "Retrieve from or write to database" with select query from database by selecting attributes as column names radio button.
    I'm unable to get these user attributes with column names.
    For eg : select tag from test_tag where rownum=1;
    I was trying so that result can be used using tag attribute (${tag}).
    Please help in this regard.
    Thanks,
    Vani

    Hi Vani,
    After the retrieve filter, add a Trace Filter and leave it as it is. Execute the policy once and in the trace data that now will be displayed there you should be able to read out the exact name and type of the parameter. This way of identifying data/parameters etc is a recommended way of working while developing! Copy paste the Trace Data from the Trace filter here if you need help!
    Cheers,
    Stefan

  • Help with ComboBox, datasource from database

    Hi there,
    i am new to Flex technology and desperately need help with
    combobox.
    I have a combobox in my app and the datasource comes from
    MySQL database. I use a PHP script to populate the combobox. Say in
    the datatabse table, I have the following result:
    id name
    1 dog
    2 cat
    3 horse
    In the app, the combobox will have the list as the name of
    the animals: dog, cat, horse. But when the user selects dog, how do
    I get the selected id 1 instead of the label "dog".
    Any help/suggestion will be appreciated.

    Hi again,
    the xml for the combobox datasource is as follows
    <animals>
    <animal>
    <id>1</id>
    <name>dog</name>
    </animal>
    <animal>
    <id>2</id>
    <name>cat</name>
    </animal>
    <animal>
    <id>3</id>
    <name>horse</name>
    </animal>
    </animals>
    and my <mx:HTTPService> is:
    <mx:HTTPService id="dropDown" useProxy="false" url="
    http://localhost/~ronnyk/combobox.php"
    resultFormat="e4x" result="get_drop_down(event)" />
    public function get_drop_down(e:ResultEvent):void{
    var dropArr:XML = e.result as XML;
    cb.dataProvider = dropArr.animal;
    cb.labelField = "name";
    cb.data = "id";
    public function clickme():void{
    txtinput.text = cb.selectedItem as String;
    I can't figure out which part I did wrong, in order to get
    the id instead of the name when the user clicks the button

  • Use same web template to display info from database

    I want to create a web template or form (for lack of the correct terminology) I can use to display database info. Database holds info on a number of members. I want to use one web template/form that can accept a query string parameter (Ex., ID number), access
    the database and display the unique info for that member.
    Using a web template/form seems like a more efficient way of achieving what I want versus creating individual member pages. Where do I start? Can you direct me to the "starting line"? Thanks.

    Hello,
    Did you means this:
    http://msdn.microsoft.com/en-us/library/ms227423(v=vs.90).aspx
    Summer

  • Help with dynamic checkbox from database results

    Hi,
    I am creating some dynamic checkboxes from the results of a database read to sqlite.  I am able to get the data and the correct number of checkboxes is being created but I'm having a problem populating the labels for the checkboxes.  Here is the section of code that gets the results from the database and creates the checkboxes.
                    var result:Array = stmt.getResult().data;
                    for each( var obj:Object in result )
                        var cb:CheckBox = new CheckBox();
                        cb.label = obj.toString();
                        cb.setStyle("color", 0x00593B);
                        cb.setStyle("symbolColor", 0x000000);
                        container.contentGroup.addElement(cb);                   
    Neil

    This was answered on another forum for me.
    The line cb.label = obj.toString();
    needed to be changed to the data.
    cb.label=obj.myDatabaseFieldName;
    myDatabaseFieldName would be whatever column you are pulling the data in from and should be the actual name in the table.
    Neil

  • Help with displaying Date from Unix seconds

    My program receives seconds taken from a Unix system and must display them on my GUI. I realize I have to convert seconds to milliseconds for the Date, plus I take into consideration the timezone.
    My problem is that everything works correctly for time zones from GMT -1:00 all the way to GMT -12:00, but GMT time and all the zones between GMT +1:00 to GMT +12:00 display the wrong time. It varies how many hours off it is.
    Does anyone have any suggestions? I have been searching for similar issues.
    here is my code:
    static public String SecToTimeOfDay(long sec)
       SimpleDateFormat  dateFormat  = new SimpleDateFormat("HH:mm:ss");
       long timeZone  = java.util.TimeZone.getDefault().getRawOffset();
       int milli = 1000;
       String date;
       if (timeZone < 0)
          timeZone = timeZone * -1;
       //convert to seconds to milliseconds
       date = dateFormat.format(new java.util.Date((sec * milli) + timeZone));
       return date;
    }

    That is not the right way to handle time zones. Try the following and see if you're still having problems.
    static public String SecToTimeOfDay(long sec){  
        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
        dateFormat.setTimeZone(java.util.TimeZone.getDefault());
        int milli = 1000;
        date = dateFormat.format(new java.util.Date(sec * milli));
        return date;
    }

  • Display image from database with jspSmart

    Hi
    I have successfully uploaded and saved images into oracle(8.1.5) table DATA_TYPE(dtid number, iconname varchar2(30), icon blob). When I try to display a specific icon in my browser, I get "javax.servlet.ServletException: General error" at:
    PreparedStatement pstmt = myConnection.prepareStatement(mySQL);
    My code looks like this:
    imgModifyDataType.jsp
    <%
    ResultSet myResultSet = null;
    Statement myStatement = null;
    Connection myConnection = null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    myConnection = DriverManager.getConnection("Jdbc:Odbc:Te","te","te");
    String iconName;
    String pDTID = request.getParameter("dtid");
    String mySQL = "Select iconname, icon from data_types where dtid=?";
    PreparedStatement pstmt = myConnection.prepareStatement(mySQL);
    pstmt.setString(1,pDTID);
    myResultSet = pstmt.executeQuery();
    iconName = myResultSet.getString("iconname");
    myUpload.initialize(pageContext);
    myUpload.downloadField(myResultSet,"icon","application/x-msdownload", iconName);
    %>
    I call this JSP from another JSP like this:
    <img src="imgModifyDataType.jsp?dtid=<%=pDTID%>">
    If we cannt display image with the help of another jsp like this then please guide me how to modify the imgModifyDataType.jsp to a servlet because I have never worked in servlets.
    Please help
    Sajid

    I think that it may help you get image from database. I used two jsp page. First one is getphoto.jsp that makes as table based in sql statment and invoke the getimage.jsp this last returns images based on
    the getphoto.jsp PhotoId.
    /** getphoto.jsp source code */
    <%@page import="java.sql.*,oracle.jdbc.*"%>
    <html>
    <head>
    <title>
    jsp1
    </title>
    </head>
    <body bgcolor="#ffffff">
    <table width="781" border="2">
    <tr<<td>
    <td width="83" bgcolor="#C0C0C0"><b>PhotoId</b><td width="450" bgcolor="#C0C0C0"><b>Description</b></td><td width="228" bgcolor="#C0C0C0"><b>Photo Image</b></td>
    <%
    Connection conn = null;
    Statement stmt = null;
    ResultSet rset = null;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection("jdbc:oracle:thin:@itas:1521:oraITAS","yourDbUserId","yourDbPassword");
    stmt = conn.createStatement();
    rset = stmt.executeQuery("select photo_id,photo_description from photo");
    while (rset.next()) {
         %>
         <tr><td width="83"><%=rset.getObject("photo_id")%></td><td width="450"><%=rset.getObject("photo_description")%></td><td width="228"><img src="getimage.jsp?PhotoId=<%=rset.getObject("photo_id")%>" width="238" height="228"></td></tr>
         <%
    conn.close();
    %>
    </table>
    </body>
    </html>
    /** getimage.jsp source code */
    <%@ page contentType="image/jpeg; chaoResult=iso-8859-1" language="java" import="java.sql.*,java.io.*,java.util.*" errorPage="" %>
    <%
    String strConnString = null;
    Connection oDbConn;
    Statement oStmt;
    ResultSet oResult;
    String strConnection = null;
    String strUserId = "c_erober";
    String strUserPwd = "sybdev99";
    String strDatabase = "oraITAS";
    String strPhotoId;
    strConnString = "jdbc:odbc:" + strDatabase;
    String strSql;
    try {
    strPhotoId = (String) request.getParameter("PhotoId");
    strSql = "select photo_image from photo" + ( (strPhotoId==null) ? " where photo_id = '001'": (" where photo_id = '" + strPhotoId + "'") );
    DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
    oDbConn = DriverManager.getConnection(strConnString,strUserId,strUserPwd);
    response.setContentType("image/jpeg");
    oStmt = oDbConn.createStatement();
    oResult = oStmt.executeQuery(strSql);
    oResult.next();
    byte[] bytearray = new byte[4096];
    int size=0;
    InputStream sImage;
    sImage = oResult.getBinaryStream(1);
    response.reset();
    response.setContentType("image/jpeg");
    response.addHeader("Content-Disposition","filename=getimage.jpeg");
    while((size=sImage.read(bytearray))!= -1 ) {
    response.getOutputStream().write(bytearray,0,size);
    response.flushBuffer();
    sImage.close();
    oDbConn.close();
    } catch (SQLException ex) { ex.getMessage();
    %>

  • I am facing a Problem with reading images from database

    Hi everybody..
    any help will be most appreciated, I am facing problem with reading images from database. I am pasting my code... 
                    string connect = "datasource = localhost; port = 3306; username = root; password = ;"; 
                    MySqlConnection conn = new MySqlConnection(connect); // creating connecting string
                    MySqlCommand sda = new MySqlCommand(@"select * from management.add_products ", conn); //creating query
                    MySqlDataReader reader; 
                    try
                        conn.Open(); // Opening Connection
                        reader = sda.ExecuteReader(); // Executing my Query..
                        while (reader.Read())
                            byte[] imgg = (byte[])(reader["Picture"]);
                            if (imgg == null)
                                pc1.Image = null;
                            else
                                MemoryStream mstream = new MemoryStream(imgg);
                                pc1.Image = System.Drawing.Image.FromStream(mstream);
    It says Parameter not Valid... i am reading all the images from database

    I agree with Viorel. You are getting the error because the format of the data is incorrect probably because the data was modify. It may not be the reading of the database the is incorrect, but the application that wrote the data into the database. You need
    to compare the imgg array data with the data before it was written to the database to see if the data matches.  I usually start by comparing the number of bytes which is easier to check then compare the actual to isolate which function is changing the
    byte count.
    An image is binary data.  The standard VS methods for reading and writing data (usually stream classes) default to ASCII encoding which will corrupt binary data.  The solution usually is to use UTF8 encoding instead of the default ascii encoding. 
    Ascii encoding with stream often aligns the data and adds extra null bytes to the end of the data which can produce these type errors.
    jdweng

  • How to display items from database using catagorylookupdroplet

    Hi everyone,
    i want to know how to display items from database using catagorylookup droplet. if anybody have any code snippet please share it.
    Thanks in advance,

    <dsp:droplet name=".................../CategoryLookup">
         <dsp:param name="id" param="itemId"/>
         <dsp:oparam name="output">
              <dsp:valueof param="element.displayName"/>
                   <%-- This is show the Child Category --%>
                   <dsp:droplet name="......................./ForEach">
                   <dsp:param name="array" param="element.childCategories"/>
                   <dsp:oparam name="outputStart">Child Categories</dsp:oparam>
                   <dsp:oparam name="output">
                        <dsp:a href="">//bydefault it will take its own file's name
                             <dsp:param name="itemId" param="element.repositoryId"/>                                                                                          <dsp:valueof param="element.displayName"/>
                        </dsp:a>
                   </dsp:oparam>                                             
                   </dsp:droplet>
                   <%-- This is show the Child Product --%>          
                   <dsp:droplet name=".............../ForEach">
                        <dsp:param name="array" param="element.childProducts"/>
                        <dsp:oparam name="outputStart">Child Products</dsp:oparam>
                                  <dsp:oparam name="output">
                                       <dsp:droplet name="................/ProductLookup">
                                            <dsp:param name="id" param="itemId"/>
                                            <dsp:param name="elementName" value="Prod"/>
                                            <dsp:oparam name="output">
                                                 <dsp:getvalueof id="img102" param="Prod.smallImage.url" idtype="java.lang.String">
                                                      <dsp:img height="250" width="250" src="<%=img102%>"/>
                                                 </dsp:getvalueof>
                                            </dsp:oparam>
                                       </dsp:droplet>
                                       <dsp:a href="productView.jsp">
                                            <dsp:param name="itemId" param="element.repositoryId"/>
                                            <dsp:valueof param="element.displayName"/>
                                       </dsp:a>
    Hope this helps.
    -RMishra

  • Help with a popup window displaying info from a record set

    Hi I am working on a Shopping cart web site I have set up my
    database and I have created my page to display items from the
    database. The fields in my database table are auto_id, category,
    sub_catagory, manufacture, style, descripition, descripition2,
    price, image, image2, fc_id, link_id
    What I am trying to do is to display this part of the info in
    one record . manufacture,style,descripition , image and price there
    will be a link from this page (link_id)to display a popup and in
    that pop up I want to display
    manufacture,style,descripition2,Image2
    basicly I want to now how to put a link in database so when
    all of the data is displayed on the page I want to click on a link
    (link_id) from any record that opens a popup to display a larger
    image and a longer descripition of the product. and anything else I
    may need from that record.
    I hope this maks sence
    Cheers
    Dave

    In your product insert form or however you are adding these
    products to the store add a feild called image link2 or
    large_img_link
    in your code for the pop up window you would wrap your PHP
    recordset like this
    <a href="
    http://yoursite.com/images/large_images/<?php
    echo $row_image_rs['large_img_link']; ?>"><?php echo
    $row_image_rs['large_img_link']; ?></a>
    This will produce a link like this
    http://yoursite.com/images/large_images/myLargeImage.jpg
    the hot spot will be your second php tag which is the
    thumbnail image itself that is now wrapped with the larger image
    link.
    Hope this is helpfull
    JM

  • Help with displaying image received from socket on Canvas

    Dear programmers
    I know that I'm pestering you lot for a lot of help but I just got one tiny problem which I just can't get over.
    I'm developing a remote desktop application which uses an applet as it's client and I need help in displaying the image.
    When a connection is made to the server, it continuously takes screenshots, converts them to jpg and then send them to the client applet via socket communication. I've got the the server doing this in a for(;;) loop and I've tested the communication and all seems to be working fine. However the applet is causing some issues such as displaying "loading applet" until I stop the server and then the 1st screenshot is displayed. Is there a way to modify the following code so that it displays the current image onto a canvas while the next image is being downloaded and then replace the original image with the one which has just been downloaded. All this needs to be done with as little flicker as possible.
    for(;;)
        filename = dis.readUTF();
        fileSize = dis.readInt();
        fileInBuffer = new byte[fileSize];
        dis.readFully(fileInBuffer, 0, fileSize-1);
        //Create an image from the byte array
        img = Toolkit.getDefaultToolkit().createImage(fileInBuffer);
        //Create a MyCanvas object and add the canvas to the applet
        canvas = new IRDPCanvas(img, this);
        canvas.addMouseListener(this);
        canvas.addKeyListener(this);
        add(canvas);
    }

    Anyone?

  • How to display data from Database individually??? Anyone can help ?

    HI,
    i i had select a row of data from database using ,
    /* Query * From Table RESOURCEORDER where po = selected no and project = selected project */
         public ResultSet getAllData() throws SQLException
         getConnection();
         Statement stmt = conn.createStatement();
         ResultSet rs = stmt.executeQuery("SELECT * FROM RESOURCEORDER WHERE PROJECT = '" + getSelProject() + "' and PURCHASEORDERNO = '" + getPo() + "'" );
         return rs;
    After that , how do i display the data individually ?
    Eg select data is ('projectA','7891203-1', '10-4-2005','lcd',2000,'121-45217-8','electrical','pending','donwong')
    i want to display them individually, like this in a page
    Projectname: /* should display the Project A*/
    P.O no:
    Date:
    Order:
    Cost:
    Acc no:
    Type:
    status:
    Orderedby:
    Can anyone help ? cos i'm new to JSP ......Thanks alot!!!!!
    Regards,
    khim

    I assume PO being a unique key, will always return 1 row from db.
    public String[] getAllData() throws Exception
    getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM RESOURCEORDER WHERE PROJECT = '" + getSelProject() + "' and PURCHASEORDERNO = '" + getPo() + "'" );
    String [] returnValue = new String[9];
    while(rs.next())
    returnValue[1] = rs.getString("colname");
    returnValue[2] = rs.getString("colname");
    ///and so on
    return returnValue;
    }Once you get that you could individually view it by setting a loop to run through the returned array.
    Hope it helps

  • I use msn internet browser and it constantly crashes with the info from event viewer: Faulting application name: msn.exe, version: 10.50.19.1000, time stamp: 0x51ddb7de this can happen numerous times in a single day help please

    Log Name:      Application
    Source:        Application Error
    Date:          2/26/2014 2:16:26 PM
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      SuperFlyXPS
    Description:
    Faulting application name: msn.exe, version: 10.50.19.1000, time stamp: 0x51ddb7de
    Faulting module name: MSHTML.dll, version: 11.0.9600.16518, time stamp: 0x52f365cb
    Exception code: 0xc0000005
    Fault offset: 0x00175363
    Faulting process id: 0x1260
    Faulting application start time: 0x01cf32a011d4aeb4
    Faulting application path: C:\Program Files (x86)\MSN\MSNCoreFiles\msn.exe
    Faulting module path: C:\Windows\system32\MSHTML.dll
    Report Id: a1704306-9f33-11e3-acde-782bcbac25e5
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <Level>2</Level>
        <Task>100</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-02-26T22:16:26.000000000Z" />
        <EventRecordID>80997</EventRecordID>
        <Channel>Application</Channel>
        <Computer>SuperFlyXPS</Computer>
        <Security />
      </System>
      <EventData>
        <Data>msn.exe</Data>
        <Data>10.50.19.1000</Data>
        <Data>51ddb7de</Data>
        <Data>MSHTML.dll</Data>
        <Data>11.0.9600.16518</Data>
        <Data>52f365cb</Data>
        <Data>c0000005</Data>
        <Data>00175363</Data>
        <Data>1260</Data>
        <Data>01cf32a011d4aeb4</Data>
        <Data>C:\Program Files (x86)\MSN\MSNCoreFiles\msn.exe</Data>
        <Data>C:\Windows\system32\MSHTML.dll</Data>
        <Data>a1704306-9f33-11e3-acde-782bcbac25e5</Data>
      </EventData>
    </Event>
    need help with . . .

    Hi,
    I found a useful link:
    MSN has encountered a problem needs to close or MSN is not responding Error
    https://answers.msn.com/solution.aspx?solutionid=11abae39-d906-4113-bb4e-ecfaa81798f0
    Please take a look of this part
    (Common Faulty Module on MSN
    Mshtml.dll)
    *Instead of MSN, here is a another software called Skype, just instroduce it to you, hope you can enjoy it.*
    Yolanda Zhu
    TechNet Community Support

  • Help with Test Server & Binding Recordset ASP-SQL

    Using CS 3.3/DW. Behavior is the same on two different
    machines. One is Vista Home Premium SP1 IIS 7 with 6 compatability,
    other is XP SP 3 IIS 5.1, both have IE 7 and full SQL 2005 with
    SP's.
    Haven't gotten very far away from static page yet, because I
    can't test. Have scoured forums and even talked to Adobe who
    recreated the problem then told me that they hadn't done sufficient
    testing to SQL 2005 prior to release, were supposed to call me
    back, did once, supposed to call back again and haven't (3 days).
    So I'm turning to the community for help, please.
    Set up test server in folder 'TServer' under
    C:\inetpub\wwwroot. Built a 'Hello World' ASP/VB Script page with
    no data attached, tests fine, puts in the appropriate folder and
    says "Hello World" in browser like a good little box should! Have
    built many DSN's, they tested during the building fine, I've tried
    various versions of ODBC and OLE DB, including but not limited to
    Native SQL Client, which is my preference and have been quite
    successful setting up the DSN's...they add to the ASP page/Site
    (it's greyed out unless you have an open ASP page) fine. Test at
    that point works fine. As soon as I bind a Recordset (whether I
    have dropped data on the page or not...same 'Hello World' page with
    Recordset info near the top of the code) and test, I error out.
    Any thoughts? I'm sure you'll need more info...I've tried to
    put as much as I can for starters. Thanks in advance.
    Peter

    When you say that you error out, what error are you getting?
    Ken Ford
    Adobe Community Expert - Dreamweaver/ColdFusion
    Fordwebs, LLC
    http://www.fordwebs.com
    "Peter AZ" <[email protected]> wrote in
    message news:g5qb7n$n30$[email protected]..
    > Using CS 3.3/DW. Behavior is the same on two different
    machines. One is Vista
    > Home Premium SP1 IIS 7 with 6 compatability, other is XP
    SP 3 IIS 5.1, both
    > have IE 7 and full SQL 2005 with SP's.
    >
    > Haven't gotten very far away from static page yet,
    because I can't test. Have
    > scoured forums and even talked to Adobe who recreated
    the problem then told me
    > that they hadn't done sufficient testing to SQL 2005
    prior to release, were
    > supposed to call me back, did once, supposed to call
    back again and haven't (3
    > days). So I'm turning to the community for help, please.
    >
    > Set up test server in folder 'TServer' under
    C:\inetpub\wwwroot. Built a
    > 'Hello World' ASP/VB Script page with no data attached,
    tests fine, puts in the
    > appropriate folder and says "Hello World" in browser
    like a good little box
    > should! Have built many DSN's, they tested during the
    building fine, I've tried
    > various versions of ODBC and OLE DB, including but not
    limited to Native SQL
    > Client, which is my preference and have been quite
    successful setting up the
    > DSN's...they add to the ASP page/Site (it's greyed out
    unless you have an open
    > ASP page) fine. Test at that point works fine. As soon
    as I bind a Recordset
    > (whether I have dropped data on the page or not...same
    'Hello World' page with
    > Recordset info near the top of the code) and test, I
    error out.
    >
    > Any thoughts? I'm sure you'll need more info...I've
    tried to put as much as I
    > can for starters. Thanks in advance.
    >
    > Peter
    >
    >

  • Display Images from Database

    Hi all,
    I require to display images stored in database along with textual description of it on a JSP.
    The image file should not be stored intermediately on file system (i.e w/o using img HTML tag)
    It is a typical shopping cart appln. where images are fetched from database and the associated description is displayed along side.
    Please note that it is the case of Mixed content types(text and binary data).
    Thanks and Regards

    Like "Breakfast" said, you can do this with a servlet that retrieves your images from a database....
    if you create a servlet to do this, you would have a generic servlet which retrieves a picture from a database based upon a key which could be a picture name or number.
    Lets say the file is out there in the database as a BLOB or Binary Image... you could have this kind of code in the doPost(HttpRequest req, HttpResponse res) or doService(HttpRequest req, HttpResponse res) method.
    The table holding the image has at least two columns one called IMAGE which holds the binary image and the other called FILENAME. If the connection to the DB is already open, you do something like this.
    String fileToGet = (String)req.getParameter("FILENAME");
    rs = conn.createStatement().executeQuery("select from IMAGE_TABLE where FILENAME='" + fileToGet + "'");
    if(rs.next())
    InputStream in = rs.getBinaryStream("IMAGE");
    res.setContentType("image/jpg"); // or whatever type of file it is.
    ServletOutputStream sout = res.getOutputStream();
    int c;
    while((c = in.read()) != -1)
    sout.write(c);
    in.close();
    sout.close();
    This should write your image to the response output of the servlet.
    Now, where you want your image, you put.
    <img src="/servlet/ImageServlet?FILENAME="thefileIwant">
    This should do what you want... Use your favorite pipe copy method to get the input stream to the output stream. If you are worried about overhead and scaling like "breakfast" said (it CAN be a problem in high access sites), then you can add an image caching scheme and get really complex.... But this is a rough idea on what to do.
    Hope this helps.
    Stephen McConnell

Maybe you are looking for

  • Repairing Startup Disk: The underlying task reported failure on exit.

    I'm running a G5 dual 2 ghz PowerPC with 2.5 ram with OS X 10.4.11. A quick rundown: I've had some crashing and dropouts of apps. nothing too extreme but not as smooth as it should be. I ran OnyX (which I do every few weeks) and it found a problem wi

  • I am trying to download a disc verion of Elements 11 to my desktop and receiving serial number error

    Hello, I am trying to download my Adobe Photoshop Elements 11 disc on my desktop computer.  I am receiving a serial number error message.  I loaded this disc on my laptop last night without any problems.  Any help would be appreciated.

  • I can't click on sign-in on one of my assignment's website

    My brother brought up this last Sunday that he can't click on a few things. I tried to go to mcgraw-hill.com website to do my homework but I can't get in. When I click on the sign-in, it doesn't click at all.

  • Can't upgrade iCloud on my PC (HP)

    I have been trying for weeks to get iCloud to update but it always get to the final stage and then gives me a message and then rolls back.  I have talked to Apple, but they are now telling me to contact my Windows vendor.  That is not helpful. Has an

  • Hallo..i wanna buy iphone 5 ,

    hallo i wanna buy iphone 5 in usa but i will use in taiwan can i buy just only the phone without wireless ?? and how much i must pay for the phone?? can i buy in your website and then you help us to send back to taiwan i will pay for the shiping fee