Getting image path from database( Remote server)  & display in jsp page

hai frnds,
i have one doudt regarding in my web application Development
. I want to Getting image path from database( **Remote server**) & display in jsp page here iam forwarding my control through Servlets
how this will passiable
Thanks in Advance
SonyKamesh
[email protected]

hai
I think ur doubt will be...
1) Getting a Image From Remote Server( & U stored a only path name in Data Base)
2) Image r stroed in saparate Drive( Not in Webroot-- where u Created domine )
Please Any Help Will be Appriciated
[email protected]
Edited by: Sonykamesha on Dec 18, 2007 11:02 PM

Similar Messages

  • How to get images dynamically from database without file paths in the table field

    I have a MS-Access database. I am working with ASP.NET. In the database there is product table in which I have "CodeNo" as a field which is a text field, and the product codes like "SM-R-2035". I also have another field "Image" which is also a text field and which have a file path in it corresponding to the particular product Image (e.g. Images\Products\SM-R-2035.jpg). So far every thing is ok. I have to update this site very frequently and lots of images are added each and every time. Its a tedious work to type the paths and file name every time and it also take a lot of time.
    What I am asking is : Is it possible to get images from a specific folder at runtime which is referenced by the "code no" itself and not the file path from the database. (Say at run time the "code no" is referenced from the database and the corresponding image is loaded dynamically from the specified folder). In other word I want to avoid the tedious work of typing.
    Can any one help with this issue. Any other simple suggestions are welcome.

    All you need to do is simple concatenation to obtain the path for the image file.  You didn't mention whether you are using VB.Net, C# or some other language to do your coding.
    If the code in your database is SM-R-2035, the file name is SM-R-2035.jpg and the path to the images foilder is Images\Products\SM-R-2035.jpg, Conceptually here is what you need to do:
    dim code_var
    dim path_var
    code_var = the code you obtain from your relevant field in the database
    path_var = "Images\Products\" & code_var & ".jpg"
    Now path_var is what you would call to obtain the image from your images folder.

  • Need to place the data from database to right position in jsp page

    hello all java prople.. i m disigning a jsp page menu..which is having deep 4 level menu.. means one heading & 4 sub menu of each menus.. which is containing data from sql database...
    i can manage connection in between jsp page & d database.. but to place the data in right position is very typical....
    i need dyanamic insertion or deletion of menu item from the database..... help me out

    This has completely nothing to do with JDBC.
    I'll give you only a hint then: "hierarchial data". Google it in combination with some smart keywords, such as "SQL" or "database".

  • Database connection and display in JSP page

    hi,
    I am new to SAP netweaver. I have created a project using JSPDynPage, Beans and java file. I have configure the datasouce in Visual Composer. I deploy the project on the portal itself. I have try all kinds of codes bt cannot retrieve. Is there anyone can give a same codes for mi to connect to the datasource in Visual Composer and able to retrieve data, insert data and update data in SQL Server 2000. Thanks
    Regards,
    shixuan

    Hai Shixuan,
    Refer this link. I will helps
    Access data from SqlServer through Visual Composer.....?
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fe/68e343cc68414da4426258d3e896ae/content.htm
    Write this code wher you need in JSPDynPage
    And
    MSSQL DataBase Access -> Help me
    Thanks and Regards
    Venkatesh
    Message was edited by:
            Venkatesh Ranganathan
    Message was edited by:
            Venkatesh Ranganathan

  • Code that handles a set of questions from database and place it on JSP

    Hi,
    How to write a code that handles a set of Quiz questions from database and place it on JSP page..
    Thanks in advance
    Haritha

    975033 wrote:
    Hi,
    I hav got the answer from you r previous link, but not completly. I need help regarding on how to do code that handles a set of questions from database and place it on JSP.
    Any help is highly appreciated.Yes but what kind of help do you expect to get? What kind of help do you think is possible through something as cold and distant as a forum, where you clearly require personal guidance and tutoring?
    If you are going to answer "example code", I should warn you that the answers are not going to be to your liking.

  • Jasper report on HTML when one image loaded from database and for the other

    How to generate jasper report on HTML when one image loaded from database and for the other we give a image path
    My code
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
              exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
              exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);
         exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);
         exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);
         exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
         exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
              exporter.exportReport();
              byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();
    Can any one help pls
    Message was edited by:
    ameet.au

    hey sorry for posting it in this forum.
    but do u have sample code for making it work.. since i am able to do it on PDF format(image from Database and another stored in the webserver) using
    byte image[] =(byte[]) outData.get("image");
                        ByteArrayInputStream img = new ByteArrayInputStream(image);
                        hmimg.put("P_PARAMV3", img);
    print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);
    bdata= JasperExportManager.exportReportToPdf(print);

  • Getting image stored in database !!

    Hey !!
    I'm really trying to solve so much problems i'm having with javafx !!
    So, like the title may suggest, i'm having problems as to get image from the database !!
    Everything seems fine but it tells me that there is "Exception while runing Application"
    here is the code !!
    @James D, i will come back bugging yu again to see how to use the stored images and display them inside the combobox and to render them ^^
    I haven't well understand how well as to use the enum struc in which yu declared the composed <Image,String> type ^^
    import java.awt.image.BufferedImage;
    import java.io.ByteArrayInputStream;
    import java.io.InputStream;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import javafx.application.Application;
    import javafx.event.Event;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.ComboBox;
    import javafx.scene.image.Image;
    import javafx.scene.image.ImageView;
    import javafx.scene.layout.StackPane;
    import javafx.stage.Stage;
    import javax.swing.JOptionPane;
    * @author Minedun6
    public class DynamicCustomComboBox extends Application {
        Connection c = connection.ConnecrDb();
       PreparedStatement pst = null;
       ResultSet rs = null;
       ComboBox box1;
       ImageView view;
        @Override
        public void start(Stage primaryStage) {
            box1 = new ComboBox();
            box1.setPrefSize(100, 25);
            box1.setOnShowing(new EventHandler() {
                @Override
                public void handle(Event t) {
                    box1.getItems().clear();
                    try {
                String sql = "select libelle_constr,img_constructeur from constructeurs where libelle_constr='Citroen';";
                pst = c.prepareStatement(sql);
                rs = pst.executeQuery();
               while(rs.next()){
                   box1.getItems().add(rs.getString("libelle_constr"));
                   InputStream input = new ByteArrayInputStream(rs.getBytes("img_constructeur"));
                   Image imge = new Image(input);
                   view.setImage(imge);
            } catch (Exception e) {
            JOptionPane.showMessageDialog(null, e);
            StackPane root = new StackPane();
            root.getChildren().addAll(box1);
            Scene scene = new Scene(root, 300, 250);
            primaryStage.setTitle("Hello World!");
            primaryStage.setScene(scene);
            primaryStage.show();
        public static void main(String[] args) {
            launch(args);
    }

    In any real application, it's a mistake to mix your presentation (user interface) code with your persistance (database access) code.
    Why? You want maintainability, flexibility, and testability.
    Maintainability:
    Suppose you want to change the structure of your database. E.g. the database admin (which may be you, or someone else) determines that the database design you have is inefficient and needs to be changed. If your database code is scattered over the whole application, mixed in among your user interface code, tracking down what needs to be changed will be a nightmare. If all your database code is in a single class, or perhaps a set of classes in a single package, then the updates are localized and much easier to manage. Furthermore, you can build the new database access code on its own, test it out, and then when you are sure it works just switch your user interface code to use the new persistance layer instead of the old one. The same applies if you decide you're going to use a completely different technology to store the data; perhaps you want to use something like Hibernate instead of plain JDBC, or maybe you decide you want to make the data accessibile via a web service.
    Flexibility:
    What if you (or, more likely, your manager) decides they're going to change to a new user interface technology. Maybe they decide to switch to a web application (i.e. HTML-based) instead of a desktop application. You obviously need to rewrite the user interface code, but you should be able to keep all the database access code you've written. If your database access code is all jumbled up with the user interface code you're replacing, it's going to be way harder to reuse that code. If the two are separated out, you just build a new user interface in whatever new technology you're using, and access the same class(es) you used for your database access without touching them.
    Testability:
    This whole thread is actually a demo of how testability is much harder if you don't properly separate your code. You posted "getting image stored in database", thinking that was your problem. It wasn't; your problem was actually an error in the way you'd set up your JavaFX code. Because the two were completely mixed together, it was hard to know where the error was. The error you had was actually a really simple one; it would have been much easier to see if you had simpler, properly separated code; but because you didn't organize your code like that it took you days to figure out the problem. This was only a couple of dozen lines of code; imagine how this looks in a real application with hundreds or thousands of classes.
    The point is that decisions about how to access your data (standalone database, web service, or EJB?; plain JDBC, JPA, Hibernate, etc?) , and decisions about the presentation technology (desktop or web? JavaFX or Swing?, or Servlets/JSPs, JSF, Swing MVC, or any of a huge number of frameworks) are completely independent. You should be in a position to change those decisions - to redesign aspects of the application - with the least amount of effort possible. Failing to properly design things will make this much harder, or likely completely impossible.
    These are real concerns that affect every application that goes into production.
    Even if you're just making a small application, it will benefit you to set things up correctly from the outset.

  • Have a error in getting the values from database randomly

    Hi to all
    I am new member to this community and new to java programming, i am the one of them who got benefited through this site , with that hope i am asking u to clear my doubt.
    Actually i want to get the data from database randomly, i dont have problem either in database connection and generating random number,its working fine. but when i have to get the data from database with generated random no using absolute function , i am getting an exception
    eg : rs.absolute(2);
    i could not move to the second row of my result set.
    not only absolute function whatever the function i am using except next method, getting exception.
    my code :
    package practical;
    import java.util.*;
    import java.sql.*;
    public class gen {
         Connection con;
         Statement s;
         ResultSet rs;
         public void get(int t)
              try
                   rs.absolute(t);
                   String question=rs.getString("question");
                   System.out.println("Random question : "+question);
              catch(Exception e)
                   System.out.println("get error");
         public void ran()
              Random r=new Random();
                   for(int i=0;i<10;i++)
                        int j=r.nextInt(10);
                        System.out.println("random value : "+j);
                        if(j!=0)
                             try
                                  get(j);
                             catch(Exception e)
                                  System.out.println("ran error");
         public void connect()
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con=DriverManager.getConnection("jdbc:odbc:ds","sa","server");
                   s=con.createStatement();
                   rs=s.executeQuery("select question from qa");
                   ran();
                   con.close();
              catch(Exception e)
                   System.out.println("error");
         public static void main(String... strins)
              new gen().connect();
    }

    but i acheived through the code which is pasted below but i have to close the database connection for every iteration.
    package practical;
    import java.util.*;
    import java.sql.*;
    public class gen {
         Connection con;
         Statement s;
         ResultSet rs;
         public void get(int t)
              int c=0;
              while(c!=t)
                   try
                   rs.next();
                   c++;
                   catch(Exception e)
                        System.out.println("next error");
              if(c==t)
              {     try
                        String question=rs.getString("question");
                        System.out.println("Random question : "+question);
                   catch(Exception e)
                        System.out.println("iteration error");
         public void ran()
              Random r=new Random();
                   int j=r.nextInt(10);
                   System.out.println("random value : "+j);
                   if(j!=0)
                        try
                             get(j);
                        catch(Exception e)
                             System.out.println("ran error");
         public void connect()
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con=DriverManager.getConnection("jdbc:odbc:ds","sa","server");
                   s=con.createStatement();
                   rs=s.executeQuery("select question from qa");
                   ran();
                   con.close();
              catch(Exception e)
                   System.out.println("error");
         public static void main(String... strins)
              for(int i=0;i<10;i++)
                   new gen().connect();
    }

  • [webdynpro] How to get the data from database and store in Excel sheet

    Hi All-
    I am developing an application in Webdynpro and I need to provide a URL ( link ) which if clicked , need to collect the data from Database ( SQL Server ) and puts in an Excel Sheet corresponding fields and opens the sheet.....
    Please look into this issue and help me out......
    Regards,
    Cris

    Hi Cris,
    Add-on to wat santosh has pointed to:
    Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)
    (Or) If you have implemented your logic to get Database records below Blog should guide you in opening an excel with ur records.
    Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)
    Regards,
    N.

  • Issue in executing an application from another remote server

    Hi Experts,
    I have an application on one of the remote server which is running on Windows Server 2003.
    I would like to execute this application from another remote server (also running on Windows Server 2003). I am able to browse the application path using "\\", but when double clicking on the application
    gives "you may not have appropriate permission to access the item"
    How do I set the permission & what permission is required?
    Please anybody can explain?
    Thanks in advance.
    Regards,
    Naveen J V

    Is this a single exe file, or is it part of an installed application with exe, dlls, registery settings, etc?
    If this is an installed application, you cannot run it like this. That would be like trying to start microsoft office which is installed on a different computer.

  • How to invoke environment variables from a remote server

    Hi Guys;
    I am new to java programming and have very basic knowledge. I am trying to get some environment variable information from a remote server. I have created a program that gives me the env variables from my machine but I need to connect to some other server and bring those variables.
    Can someone help me with this?
    Regards,
    Aditya

    there is no way to get that information from a remote machine without that machine having some program installed on it that you can poll to ask for it (and no machine should have a program like that on it, it's a potentially massive security hole).

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

  • Get all groups from an AD Server

    Hi everyone,
    I'm trying to get all groups from and AD server.
    Here's how I'm doing it:
    DirContext ctx = new InitialDirContext( (Hashtable<String,String>) env);
              Name n2 = new CompositeName().add(groupsContainer);
              NamingEnumeration<Binding> contentsEnum = ctx.listBindings(n2);
              int i = 1;
              while ( contentsEnum.hasMore() && (i++) < 1000 )
                   Binding binding = contentsEnum.next();
                   groups.add(binding.getName().substring(3));
              return groups; The problem is, I always get an error if I don't restrict the results number to below 1000.
    The error is the following *javax.naming.SizeLimitExceededException: [LDAP: error code 4 - Sizelimit Exceeded];*
    After googling, I found it it's due to a field in the AD Server, that restrict the result number.
    So there is no way that I can obtain all groups without changing that field?
    Regards,
    Nuno.

    Hi Nuno,
    You have to increase the MaxPageSize value at ActiveDirectory level to retrieve results more than 1000. By default the MaxPageSize value is 1000. There is no option other than increasing the MaxPageSize value.
    Thanks & Regards,
    Murali.
    ============

  • HT2500 how do i get my mail from the pop server to my inbox

    Can someone please help me ! I'm sure I did something by accident and don't know how to fix it. My problem is i don't see any emails in my inbox, however my account info says there is mail on the pop server. how do i get the mail from the pop server to my inbox?
    thank you for helping

    First try rebuilding your Inbox.
    Select the Inbox.
    Under Mailbox in the Menu bar select Rebuild (last option in list)
    Note: If you delete a POP account in Mail, it will delete any messages in the Inbox. It does not delete your custom folders or your sent messages.
    If the messages have been deleted and are no longer on the server, you can restore from Time Machine.
    Let us know if this helps.

  • Automator Stops Responding while trying to perform "Get Image URLs from Webpage"

    I have seen it in many tutorials, and it seems strait forward enough, so here is my order of events for my scriptl;
    Get Current Webpage from Safari
    Get Image URLs from Webpage [linked from these webpages]
    Download URLs [Downloads]
    However when I run this script it returns the get current webpage quickly but then hangs on Get Image URLs from webpage either never passes or takes 700+ seconds to move to the next step.
    The times it did pass to the next step it worked 98% still missed images occasionaly.
    After I figure out how to fix this issue, I am looking for a way to make it create a new folder, and name it according to the sub directory of the webpage, for example:
    http:\\www.mypictures.com\Birthday\01.JPG
    http:\\www.mypictures.com\Birthday\02.JPG
    would create folder Birthday, and save images 1 and 2
    Then in the future I want to download another set such as;
    http:\\www.mypictures.com\MothersDay\01.JPG
    http:\\www.mypictures.com\MothersDay\02.JPG
    As these are both named 01.JPG the sets would overwrite, or add strange numbers and not divide by set by default;
    So I need this script to create folders based on Directory (portion of url)  In my example it would be MothersDay, and Birthday folders.
    Any help would be greatly appreciated!
    Thanks in advance!
                    Mike

    I should add, it has simply frozen and stopped responding about 95% of the 20 times or so I have run it. I have tried rebooting (not sure if that helps on Mac, I'm still new to the OS been a windows user for a long time but so far I love my Mac).

Maybe you are looking for

  • Need of blocking sales orders?

    Hai all,         why do we block sales orders, and where can we find these information(tables), indicating that a particular sales order has been blocked, can anybody give me complete scenario of blocking sales orders.                                

  • Error in creating a trigger

    i am creating a trigger i am getting an error create or replace TRIGGER INS_Discharge AFTER INSERT ON Discharge FOR EACH ROW AS declare vr_DischargeType INT ; vr_Visit_ID INT ; vr_Discharge_Date DATE; vr_VisitDate DATE; vr_AdmTime varchar(5) ; vr_Tra

  • Search for one word in the adress bar with google when proxy is enabled.

    I have downloaded Firefox Version 30 and set up my company proxy. I use the address bar to search at google. Since I have configured the proxy I'm not able to search for only one word like 'fibonacci', if I search for 'fibonacci number' it still work

  • Delivery Created with out Material Number

    HI I created an STO for material, when i have done the VL10B i got a message "See log for information about creating deliveries" A Delivery got created with out the Material number, When i look in the Document Flow for the Delivery Created its preced

  • Downloading a Trial version of Flash

    Hi I recently learnt of the Subscription edition for Adobe creative Suite 4 design premium being offered in Australia & I wanted to download a trial version of Flash (which is one of the programs I am most interested in) to see if it would be worth s