Tuesday 24 July 2012

Connect MS-ACCESS database using jsp and php

// siddhu vydyabhushana // Leave a Comment

1) hello friends today am wana show u how we can connect ms access using "jsp" and "php" also
 
2) first of open ms access and edit the content (but u must and should have basics of database)
 
   i)take the blank document ii)and rename it iii)and right click on "table1" iv)goto "design view"
 
    v)and delete the coloum of "id" vi)add tuples what u like

3) if u have tomcat->web apps->" new folder (your project name)" save it in tomcat or save it in
    any folder.

4) open control panel->(choose large icons in view by)->open Administration Tools->Double click
    on ODBC->select system DSN->add ->(Microsoft Access Driver *.accb,*.mdb)->dont bother about
    database name here u can give ur name also ,if u give ur name u will use that name on conn.

5) half of the work completed .

6) at next u will go for my tutorial video for better understand , you can download this video
     also.
                 <------------------VYDYABHUSHANA SIDDHU(vydyas.blogspot.com)----------------->


DATABASE CONNECTION USING JSP TO CONNECT AND INSERTING VALUES:



<html>
<body>
<%@ page import="java.sql.*"%>
<%
try
    {
        String user1=request.getParameter("user");
        String email1=request.getParameter("email");
        String pass1=request.getParameter("pass");
int  flag=0;
String str=Integer.toString(flag);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection con=DriverManager.getConnection("jdbc:odbc:epoll","","");
PreparedStatement pst= con.prepareStatement("insert into user values(?,?,?,?)");
pst.setString(1,user1);
pst.setString(2,email1);
pst.setString(3,pass1);
pst.setString(4,str);
pst.executeUpdate();
con.close();
    }
catch(Exception e)
    {
        out.println("done exception"+e);
    }
%>
<jsp:include page="epoll.html"/>

</body>
</html>

video link will be updated soon.....................

0 comments:

Post a Comment