Doneen
asked on
JSP & Access
Can i use access with JSP??
If so has anyone got code i can use to connect to a Access database,
read from it,display this on the web,
Also has anyone code on how to insert with JSP,
I know how to create SQL statements I basically need the the JSP code to open the link to the database,display the info etc, and to assign variables that can be used to pass to the database fields
If so has anyone got code i can use to connect to a Access database,
read from it,display this on the web,
Also has anyone code on how to insert with JSP,
I know how to create SQL statements I basically need the the JSP code to open the link to the database,display the info etc, and to assign variables that can be used to pass to the database fields
To move your question to the correct topic area ask for support in this topic area:
https://www.experts-exchange.com/Community_Support/
https://www.experts-exchange.com/Community_Support/
ASKER
all JSP code in general for form a web page would be appreciated,
an overall example of a page accessing a database,display & inserting into the database would be I feel the best possible solution for me.
I could then edit it to connect to my own database and read from it,
Drop down menus being created from field in the database would be very useful,
Thanks,
Shane.
PS-I could do with an answer to this fairly soon,so any help would be appreciated.
an overall example of a page accessing a database,display & inserting into the database would be I feel the best possible solution for me.
I could then edit it to connect to my own database and read from it,
Drop down menus being created from field in the database would be very useful,
Thanks,
Shane.
PS-I could do with an answer to this fairly soon,so any help would be appreciated.
But you are again in wrong topic area.
This is JavaScript topic area.
To end your Odyssey look here:
http://cse-ferg41.unl.edu/docs/DevelopmentDocs/jdbcpage/jdbc.htm
This is JavaScript topic area.
To end your Odyssey look here:
http://cse-ferg41.unl.edu/docs/DevelopmentDocs/jdbcpage/jdbc.htm
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is the Login.jsp
<%@ include file="vw02Constantes.jsp"% >
<%@ page import="vw02.com.*"%>
<%@ page import="vw02.Vw02Login"%>
<%
boolean paginaLogin = true;
String error = "";
String usuario = "";
Vw02Sesion sess = null;
// Check it there is a session already
sess = new Vw02Sesion(session, true);
if (sess.haySesion()) {
%>
<SCRIPT>
alert("There is a session already");
parent.location.href="star t.jsp";
</SCRIPT>
<%
}
// if not Check if the user has logged in
if (request.getParameter(ENTR AR) != null) {
if (OK.equals(request.getPara meter(ENTR AR))) {
paginaLogin=false;
usuario = request.getParameter(Vw02C onstantes. LOGIN);
Vw02Login login = new Vw02Login(request);
try {
if (login.enter()) {;
%>
<SCRIPT>
parent.location.href="star t.jsp";
</SCRIPT>
<%
} else {
error = "User o Password Failed, try again";
paginaLogin=true;
}
} catch(Exception e){
e.printStackTrace();
paginaLogin = true;
error = "Unexpected Error. Try Later";
}
}
}
if (paginaLogin) {
%>
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT language="JavaScript" src="/VW02/Motivacion/Prog rama/js/sc ripts.js"> </SCRIPT>
<SCRIPT language="JavaScript">
function send() {
frm = document.forms[0];
if (frm.<%=Vw02Constantes.LOG IN%>.value =="") {
alert("Please, Enter User Name.");
frm.<%=Vw02Constantes.LOGI N%>.focus( );
return false;
} else if(frm.<%=Vw02Constantes.C LAVE%>.val ue=="") {
alert("Please Enter Password.");
frm.<%=Vw02Constantes.CLAV E%>.focus( );
return false;
}
return true;
}
</SCRIPT>
</head>
<body bgcolor="#000066" text="#0066FF" leftmargin="0" topmargin="0">
<table width="100%" border="0">
<tr>
<td width="9%"><img src="lv55.gif" width="82" height="81"></td>
<td width="86%">
<h1 align="center"><font face="Arial, Helvetica, sans-serif"><font size="5">LOGIN PAGE</font></font></h1>
</td>
<td width="5%"><img src="VW.gif" width="82" height="81"></td>
</tr>
</table>
<form name="frm" method="post" action="<%=LOGIN_JSP%>" onsubmit="return send()">
<input type="hidden" name="<%=ENTRAR%>" value="<%=OK%>">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div align="center">
<table width="50%" border="1">
<tr>
<td>
<table width="100%" border="0">
<tr>
<td width="17%" height="25"> </td>
<td width="13%" height="25"> </td>
<td width="28%" height="25"> </td>
<td width="42%" height="25"> </td>
</tr>
<tr>
<td width="17%"> </td>
<td width="13%"> </td>
<td width="28%"> </td>
<td width="42%"> </td>
</tr>
<tr>
<td width="17%"> </td>
<td width="13%">Usuario:</td>
<td width="28%">
<input type="text" name="<%=Vw02Constantes.LO GIN%>" value="<%=usuario%>">
</td>
<td width="42%"> </td>
</tr>
<tr>
<td width="17%" height="32"> </td>
<td width="13%" height="32">Clave:</td>
<td width="28%" height="32">
<input type="password" name="<%=Vw02Constantes.CL AVE%>" value="">
</td>
<td width="42%" height="32">
<div align="center">
<input type="submit" name="bLogin1" value="Conectar">
</div>
</td>
</tr>
<tr>
<td width="17%" height="36"> </td>
<td width="13%" height="36"> </td>
<td width="28%" height="36"> </td>
<td width="42%" height="36"> </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
<% if(!"".equals(error)) { %>
<SCRIPT>
alert("<%=error%>")
</SCRIPT>
<% } %>
</body>
</html>
<% } %>
<%@ include file="vw02Constantes.jsp"%
<%@ page import="vw02.com.*"%>
<%@ page import="vw02.Vw02Login"%>
<%
boolean paginaLogin = true;
String error = "";
String usuario = "";
Vw02Sesion sess = null;
// Check it there is a session already
sess = new Vw02Sesion(session, true);
if (sess.haySesion()) {
%>
<SCRIPT>
alert("There is a session already");
parent.location.href="star
</SCRIPT>
<%
}
// if not Check if the user has logged in
if (request.getParameter(ENTR
if (OK.equals(request.getPara
paginaLogin=false;
usuario = request.getParameter(Vw02C
Vw02Login login = new Vw02Login(request);
try {
if (login.enter()) {;
%>
<SCRIPT>
parent.location.href="star
</SCRIPT>
<%
} else {
error = "User o Password Failed, try again";
paginaLogin=true;
}
} catch(Exception e){
e.printStackTrace();
paginaLogin = true;
error = "Unexpected Error. Try Later";
}
}
}
if (paginaLogin) {
%>
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT language="JavaScript" src="/VW02/Motivacion/Prog
<SCRIPT language="JavaScript">
function send() {
frm = document.forms[0];
if (frm.<%=Vw02Constantes.LOG
alert("Please, Enter User Name.");
frm.<%=Vw02Constantes.LOGI
return false;
} else if(frm.<%=Vw02Constantes.C
alert("Please Enter Password.");
frm.<%=Vw02Constantes.CLAV
return false;
}
return true;
}
</SCRIPT>
</head>
<body bgcolor="#000066" text="#0066FF" leftmargin="0" topmargin="0">
<table width="100%" border="0">
<tr>
<td width="9%"><img src="lv55.gif" width="82" height="81"></td>
<td width="86%">
<h1 align="center"><font face="Arial, Helvetica, sans-serif"><font size="5">LOGIN PAGE</font></font></h1>
</td>
<td width="5%"><img src="VW.gif" width="82" height="81"></td>
</tr>
</table>
<form name="frm" method="post" action="<%=LOGIN_JSP%>" onsubmit="return send()">
<input type="hidden" name="<%=ENTRAR%>" value="<%=OK%>">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div align="center">
<table width="50%" border="1">
<tr>
<td>
<table width="100%" border="0">
<tr>
<td width="17%" height="25"> </td>
<td width="13%" height="25"> </td>
<td width="28%" height="25"> </td>
<td width="42%" height="25"> </td>
</tr>
<tr>
<td width="17%"> </td>
<td width="13%"> </td>
<td width="28%"> </td>
<td width="42%"> </td>
</tr>
<tr>
<td width="17%"> </td>
<td width="13%">Usuario:</td>
<td width="28%">
<input type="text" name="<%=Vw02Constantes.LO
</td>
<td width="42%"> </td>
</tr>
<tr>
<td width="17%" height="32"> </td>
<td width="13%" height="32">Clave:</td>
<td width="28%" height="32">
<input type="password" name="<%=Vw02Constantes.CL
</td>
<td width="42%" height="32">
<div align="center">
<input type="submit" name="bLogin1" value="Conectar">
</div>
</td>
</tr>
<tr>
<td width="17%" height="36"> </td>
<td width="13%" height="36"> </td>
<td width="28%" height="36"> </td>
<td width="42%" height="36"> </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
<% if(!"".equals(error)) { %>
<SCRIPT>
alert("<%=error%>")
</SCRIPT>
<% } %>
</body>
</html>
<% } %>
Here is the start.jsp wich only populates the Countries drop down list.
<%
Vector vPaises = null;
Vw02Paises oPais = new Vw02Paises();
vPaises = sess.getPaises();
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000066" text="#FFFFFF" leftmargin="0" topmargin="0" onLoad="init();">
<div align="center"> <font face="Arial, Helvetica, sans-serif">
<select name="paises" onchange="javascript:carga listas(thi s);">
<option selected>Seleccione Pais</option>
<%
if (vPaises!=null) {
for (x=0; x<vPaises.size() ; x++) {
oPais = (Vw02Paises)vPaises.get(x) ;
%>
<option value="<%=oPais.getCodigoP ais()%>"> <%=oPais.getNombre()%> </option>
<%
oPais = null;
}
}
%>
</select>
</font>
</div>
</body>
</html>
Have Fun
Javier
<%
Vector vPaises = null;
Vw02Paises oPais = new Vw02Paises();
vPaises = sess.getPaises();
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000066" text="#FFFFFF" leftmargin="0" topmargin="0" onLoad="init();">
<div align="center"> <font face="Arial, Helvetica, sans-serif">
<select name="paises" onchange="javascript:carga
<option selected>Seleccione Pais</option>
<%
if (vPaises!=null) {
for (x=0; x<vPaises.size() ; x++) {
oPais = (Vw02Paises)vPaises.get(x)
%>
<option value="<%=oPais.getCodigoP
<%
oPais = null;
}
}
%>
</select>
</font>
</div>
</body>
</html>
Have Fun
Javier
ASKER
applekanna
Can anyone suggest where I could get a suitablle driver,for the piece of code you posted,
I have been away for awhile hence i was not working on this ,
thanks for all your help,
I am just looking to connect to the database first and will go into more detail once i get this done,
Thanks again,
any help would be greatly appreciated,
Doneen.
Can anyone suggest where I could get a suitablle driver,for the piece of code you posted,
I have been away for awhile hence i was not working on this ,
thanks for all your help,
I am just looking to connect to the database first and will go into more detail once i get this done,
Thanks again,
any help would be greatly appreciated,
Doneen.
The jdbcodbc driver comes with the JDK you should have it
Javier
ASKER
I don't think I have a JDK,
I am using iplanet a netscape webserver,
And am coding it with Dreamweaver,
Any suggestion,
or does this make sense the way I am tryin to do it??
I am using iplanet a netscape webserver,
And am coding it with Dreamweaver,
Any suggestion,
or does this make sense the way I am tryin to do it??
Well if you're using iPlanet then you sure have a jdk, iPlanet is java based and can not work without a jdk, anyway have you tryied downloading one from the sun page http:\\www.sun.com
besides that you should need an ODBC DNS entry to pion your access database.
Any further questions do not doubt to ask
:c)
Javier
besides that you should need an ODBC DNS entry to pion your access database.
Any further questions do not doubt to ask
:c)
Javier
https://www.experts-exchange.com/Web/Web_Languages/JSP/