Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

JS

Ads

 
 

Share on Google+Share on Google+

Saakshi Dikshit
JS
2 Answer(s)      7 years ago
Posted in : JSP-Servlet
<%
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:newdsn","sa","master");
Statement stat=con.createStatement();
ResultSet res=stat.executeQuery("select p_id,p_name,quote from painting");
while(res.next())
{
%>
<tr><td><%=res.getString(1).toString()%></td>
<%
String pnt=res.getString(2).toString();
%>
<td><a href="<%=pnt%>.html"><%=pnt%></a></td>
<td><%=res.getString(3).toString()%></td>
</tr>
<%
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
%>

I'm using the above JSP code to view the photos uploaded. I'm able to successfully upload the photos. The photos are being saved in a drive of my system. Can somebody help me out with this problem as to how i will view the photos uploaded. If i put the code for downloading between the the above lines of code the code does not run properly. I cannot also redirect the upload page to download page since it's a dynamic website and the user views the photos at his will, the constraint of viewing the photo directly after uploading is quiet unfriendly and it will show the photo you just uploaded. We are trying to develop a hyperlink to each image so that the user is able to view all the photos uploaded so far.

Please i'll be extremely thankful if somebody helps me get out of this problem.
Ads
View Answers

April 24, 2010 at 11:26 AM


Hi Friend,

Have you insert the uploaded file into the database?

Do you want to retrieve all the files?

Please clarify this.

Thanks


April 24, 2010 at 5:37 PM


no the uploaded file has been saved in a drive of my pc only the name of the file is being saved in the table. The name of the file is exactly the same as that of the photo uploaded.
<%=res.getString(1).toString()%> by using the following lines we extract all the records from the table and display it in tabular form.

Ads









Related Tutorials/Questions & Answers:
EXT JS
EXT JS   i want to create a grid in extjs to display data from mysql and if i want to edit the data i must update through extjs only and must update in mysql database. please help me with sample code. thank you
Lightbox JS
Lightbox JS/font>       Lightbox JS is a simple, unobtrusive script used to overlay images on the current page. It`s a snap to setup and works on all modern browsers. Read full
Advertisements
xls to js using javascript
xls to js using javascript  ![how can we convert a xls file in js file using javascript][1
Version of rhino>js dependency
List of Version of rhino>js dependency
Version of jaxme>jaxme-js dependency
List of Version of jaxme>jaxme-js dependency
Version of com.butor>butor-js dependency
List of Version of com.butor>butor-js dependency
Version of com.cognitect>transducers-js dependency
List of Version of com.cognitect>transducers-js dependency
Version of com.cognitect>transit-js dependency
List of Version of com.cognitect>transit-js dependency
Version of com.synhaptein>scalator-js dependency
List of Version of com.synhaptein>scalator-js dependency
Version of com.belteshazzar>junit-js dependency
List of Version of com.belteshazzar>junit-js dependency
js,,mysql - JSP-Servlet
js,,mysql  Hi, I want a jsp code for editing,deleting data retrieved from from the mysql database and displayed in a html page .Can anybody provide me a code for including edit and delete options with the following code
Configure Js request in Web.xml
Configure Js request in Web.xml  Hi all, I have 1 basic doubt,suppose i have 2 jsp,1 servlet,1 web.xml file.i need to redirect 1 page via servlet with help of web.xml file.Here just i need to redirect to mainCtrl.java
Help for website development on Angular JS
Help for website development on Angular JS  want to develop a website using angular JS. I am new to the platform or coding on angular JS. Can i update a database column and get that data uploaded on my webpage simultaneosuly
Maven Dependency js >> 1.5R3
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.5R3 in your project
Maven Dependency js >> 1.5R4.1
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.5R4.1 in your project
Maven Dependency js >> 1.5R4-RC3
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.5R4-RC3 in your project
Maven Dependency js >> 1.6R1
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.6R1 in your project
Maven Dependency js >> 1.6R2
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.6R2 in your project
Maven Dependency js >> 1.6R3
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.6R3 in your project
Maven Dependency js >> 1.6R5
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.6R5 in your project
Maven Dependency js >> 1.6R6
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.6R6 in your project
Maven Dependency js >> 1.6R6-candidate2
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.6R6-candidate2 in your project
Maven Dependency js >> 1.6R7
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.6R7 in your project
Maven Dependency js >> 1.7R1
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.7R1 in your project
Maven Dependency js >> 1.7R2
You should include the dependency code given in this page to add Maven Dependency of rhino >> js version1.7R2 in your project
Version of com.lihaoyi>utest-js-plugin dependency
List of Version of com.lihaoyi>utest-js-plugin dependency
Version of com.marekkadek>rxscala-js-cats_sjs0.6_2.11 dependency
List of Version of com.marekkadek>rxscala-js-cats_sjs0.6_2.11 dependency
Version of com.marekkadek>rxscala-js-cats_sjs0.6_2.12 dependency
List of Version of com.marekkadek>rxscala-js-cats_sjs0.6_2.12 dependency
Version of be.tzbob>scala-js-snabbdom_sjs0.6_2.12 dependency
List of Version of be.tzbob>scala-js-snabbdom_sjs0.6_2.12 dependency
Version of cat.inspiracio>rhino-js-engine dependency
List of Version of cat.inspiracio>rhino-js-engine dependency
Version of cn.jhc>umeditor-vaadin-js dependency
List of Version of cn.jhc>umeditor-vaadin-js dependency