Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Saakshi Dikshit
JS
2 Answer(s)      4 years and 6 months 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.

Advertisement
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.


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
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
calling servlet from JS and return response from servlet to JS
calling servlet from JS and return response from servlet to JS  hello all, I am working on JSP-servlets n MVC.I am facing a problem. on the web..."; response.setContentType("text/plain"); response.getWriter().write(url); in js function
Ext Js form example.
; In this simplified application and easy to learn Ext Js Tutorial I will show you how to develop a form in Ext Js framework. The Ext Js form will take...; framework in shortest possible time. Ext JS provides UI elements for developing web
Create a input button inside js function
Create a input button inside js function  I call my js function from HTML code from another file. Now I would like to create a input button on page... is the right way   I call my js function from HTML code from another file
Easiest method for expiring the css and js headers
Easiest method for expiring the css and js headers  Hi, I have a website with many thousand users visiting per day. I have changes the css file and uploaded it on server. Now some user is getting the old css file. Let's know
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?
) by calling the function from js?  How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js? I set... is written in js. Is there any solution
Ext
Ext       Ext Js  form example In this simplified application and easy to learn Ext Js Tutorial I will show you how to develop a form in Ext Js framework. The Ext Js form
JS-Sorcerer: JavaScript Development Tool
JS-Sorcerer: JavaScript Development Tool       JavaScript Reporter finds problems in JavaScript files in a single step, letting you spend more time improving your website
Downloading and Installing jQuery
for developing our demo application. jQuery comes as single js file. So, its very easy...://jquery.com/ and download jquery-1.2.6.min.js and add into js directory
Ofbiz framework - Java Beginners
Ofbiz framework  Hi All, Im new to Ofbiz framework.Can anyone please tell me how to pass a particular div id in a ftl to a js through the js call in that particualr ftl
PHP/HTML/AJAX Question
PHP/HTML/AJAX Question  I have a PHP/HTML program that sends a parm to a .JS program using Ajax logic (onchange) and it returns it. It returns... should the code to do it be (in the .js or as a html or PHP statement
how to access javascript in mozilla - Java Beginners
in .js file and i am calling that file in .jsp file as but the script... that both the html file and the js file should be in same location. HTML file JS file function onPress(){ alert("i m in another
q - JSP-Servlet
and at runtime it save in .js file from that we show data in html control like... of data is save in .js file though repititive value is shown in dropdown control... it should first clear the data from .js file and then reload the data again  
dynamic creation of multiple drop-down menus
dynamic creation of multiple drop-down menus  can anybody plz help me in coding for dynamic creation of multiple drop-down menus in a webpage using ajax/js/html/css
Advertisements
 

 

 

DMCA.com