insert code jsp to access

Ads
 

insert code jsp to access

insert code jsp to access

View Answers

March 25, 2011 at 12:00 PM

<%@page import="java.sql.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:student","","");

Statement st=con.createStatement();
int i=st.executeUpdate("insert into data(name,address) values('Roseindia','Delhi')");
out.println("Data is inserted successfully");
%>

February 2, 2012 at 10:48 PM

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@page import ="javax.servlet.*" %>
<%@page import= "javax.servlet.jsp.*" %>
<%@ page language="java" %>

<%
JspWriter wr = pageContext.getOut();
Connection con=null;
PreparedStatement pst=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:ruhi","system","system");
pst=con.prepareStatement("insert into repository values(?,?,?,?,?)");
File file=new File("C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Water lilies.jpg");
FileInputStream fis=new FileInputStream(file);
pst.setString(1,"Ship");
pst.setString(2,"Detroit");
pst.setString(3,"yes");
pst.setString(4,"CompleteProduct");
pst.setBinaryStream(5 ,fis, (int)fis.available());
int i = pst.executeUpdate();
if(i!=0){
wr.write("image inserted successfully");
}
else{
wr.write("problem in image insertion");
}
}
catch (Exception e){
System.out.println(e);
}

%>

Last edited b

Ads









Related Tutorials/Questions & Answers:
insert code jsp to access
insert code jsp to access   insert code jsp to access
code for insert the value from jsp to access database
code for insert the value from jsp to access database  code for insert the value from jsp to access database
Advertisements
how to insert values from jsp into ms access
how to insert values from jsp into ms access   how to insert values using jsp into ms access database
how to access element added via javascript dynamically using jsp code
not able to access these dynamically added textboxes values from my jsp code...how to access element added via javascript dynamically using jsp code ... javascript dynamically using the jsp code. i am adding empty records on .jsp page
insert query in jsp
insert query in jsp  give me insert code in jsp at run time
jsp to access query
jsp to access query  How to insert the values from jsp to access ?   Here is a jsp code that insert the values to MS access database...) Restart your server and run your jsp code. <%@page import="java.sql.*"%> <
jsp code
jsp code  what are the jsp code for view page in online journal
code for insert button
code for insert button    i want code for insert button(in image...;The given code uses Swing components to create a image button and allow the user..."); PreparedStatement pstmt = conn.prepareStatement("insert into data(name
JSP CODE
JSP CODE  what is the code for downloading images from database using JSP?   Please visit the following link: http://www.roseindia.net/jsp/downloadimage.shtml
How to access the database from JSP?
How to access the database from JSP?  Hi, What is the process... you can access the database by embedding the JDBC code. But this is not the best... database from JSP which explains you how to access the database by embedding
jsp code
jsp code  hi i am Ruchi can anybody plz tell me the jsp code... visit the following links: http://www.roseindia.net/jsp/user-search.shtml http://www.roseindia.net/servlets/search.shtml www.roseindia.net/jsp/searchbook.shtml
jsp code
jsp code  i want health management system project code using jsp.its urgent
source code in jsp
source code in jsp  how to insert multiple images in jsp page of product catalog
JSP CODE
JSP CODE  Please help me as soon as possible.Its Urgent. I am working on my college ALUMNI PORTAL. I want to have a ADD FRIEND option in a user's profile. Please send me code
JSP code
JSP code  I get an error when i execute the following code : <... = "insert into name(firstname,lastname) values(?,?)" ; Statement st = con.createStatement(); st.executeQuery(query); %> <jsp:forward page="address.jsp">
jsp code
jsp code  i want to jsp code which are working as,i have three drop down menu 1st menu for class second menu for subject and third menu as chapter... according to selectde menu,,,,please send me such type code,,,,plz help me
jsp code
jsp code  how to display date in drop down list by jsp thus the date start from current date and for next year it has to check leap year function to february then it display 30 for some months else 31 for other months
code in jsp
code in jsp  hi.. I had started a project on college admission system in which two operators has been introduced one is admin who can view all... want a code to sort a list of students on the basis of there 12% marks and AIEEE
JSP and Database access
JSP and Database access  Hi, Please help me with the following program. I am not able to update all the pa column values in my database. csea.jsp: <html> <body> <%@page import="java.sql.*"%> <form method
problem in jsp using ms-access
)Your DSN will get created. 6) Restart your server and run your jsp code. Here... will get created. 6) Restart your server and run your jsp code. Here is your...problem in jsp using ms-access  after starting server(tomcat) wen v
how to insert, retrieve data from,to db(code)....
how to insert, retrieve data from,to db(code)....  Hi..... i ve... db. cn u plz tel me the code in detail.n i thk it shud b written in jdbc.....i ve written sum code,bt gting so many doubts in that....so plzzzz help
insert and retrive image from sql server database in jsp
insert and retrive image from sql server database in jsp  what is the code to insert and retrive an image from sql server database in jsp
JSP code for forget password
JSP code for forget password  I need forget password JSP code.. example http://www.roseindia.net/users/forgotpassword.html
jsp code for shopping cart
jsp code for shopping cart  please provide me the jsp code for online shopping cart
insert , edit , and delete button in one jsp page
insert , edit , and delete button in one jsp page  hello I want to ask about the way of creating a jsp page contains insert , edit , and delete buttons and manipulate data in database directly. any help please or hints
tree using jsp code
tree using jsp code  i want to draw a tree structure of a family hierarchy using jsp code
how to insert, retrieve data from,to db(code)....
how to insert, retrieve data from,to db(code)....  Hi, i have created login page n in that a registration form also in jsp, my doubt is-when new user... plz tel me the code in detail.n i thk it shud b written in jdbc.....i ve
JSP code problem - JSP-Servlet
JSP code problem  HI.. I have a DB2 stored procedure wich return a result set. I have made a report basing on this procedure using Crystal Reports. How to pass parameters to this procedure with java code in a JSP page
need JSP Code.
need JSP Code.  **Hi I need JSP code for selling Products which are in Database. Please can any one help for this.URGENT... Thank You..! Abhijeet
source code in jsp
source code in jsp  i need the source code for online payment in jsp
How to access the Title tag from xml to jsp
How to access the Title tag from xml to jsp  How to access the Title tag from xml to jsp   Please visit the following link: http://www.roseindia.net/jsp/parsing-xml.shtml The above link will provide you an example

Ads