0 Replies Latest reply: May 17, 2008 8:06 AM by 843844 RSS

    I cannot view image from mssql server on windows vista

    843844
      hai i am saravanan
      i retrieve image from Microsoft sql server on windows xp but that same coding not running on windows vista .please anyone give correct solution.this is my coding

           <%
           String tradeNo,tradeName,propName,propAddress,agentAddress,imageName,gf;
           byte image[];
           con = DriverManager.getConnection("jdbc:odbc:img");
           st=con.createStatement();
           rs=st.executeQuery("select * from TradeMaster");
           while(rs.next())
           {
           tradeNo=rs.getString("TradeNo");
                tradeName=rs.getString("TradeName");
                propName=rs.getString("PropName");
                propAddress=rs.getString("PropAddress");
                agentAddress=rs.getString("AgentAddress");
                image=rs.getBytes("TradePicture");
                imageName=rs.getString("ImageName");
                String sk="C:\\Program Files\\Apache Group\\Tomcat 4.1\\webapps\\gct\\image\\";
           gf=sk+imageName;
      FileOutputStream ni=new FileOutputStream(gf);     
           for(int i=0;i<image.length;i++)
      ni.write(image);     
                
           %><option value="<%=tradeNo+"+"+tradeName+"+"+propName+"+"+propAddress+"+"+agentAddress+"+"+gf%>"><%=tradeNo%></option>
           <%
           }
           %>
      </select> </td>
      </tr>

      here FileOutputStream cannot write image into particular path.please give solutions.