Foros del Web » Programación para mayores de 30 ;) » Java »

Como Conectar Un Jsp A Una Base De Access

Estas en el tema de Como Conectar Un Jsp A Una Base De Access en el foro de Java en Foros del Web. HOLA QUIERO SABER COMO HACER UNA CONEXION AUNA BASE EN ACCESS DESDE UN JSP LO HE HECHO EN JAVA Y SI FUNCIONA PERO LA BASE ...
  #1 (permalink)  
Antiguo 28/09/2006, 18:54
 
Fecha de Ingreso: julio-2006
Mensajes: 17
Antigüedad: 17 años, 9 meses
Puntos: 0
Como Conectar Un Jsp A Una Base De Access

HOLA QUIERO SABER COMO HACER UNA CONEXION AUNA BASE EN ACCESS DESDE UN JSP LO HE HECHO EN JAVA Y SI FUNCIONA PERO LA BASE ESTA EN ACCESS Y ASI LA QUIEREN ...

POR FAVOR SI ALGUIEN TIENE EL CODIGO DE UNA CONEXCION A UNA DB EN ACCESS PASENMELO

LA BASE ESTA EN LA MISMA CARPETA DE LOS JSP

ESTO E SLO QU ETENGO PEOR NO ME FUNCIONA

PreparedStatement pstmt = null;
ResultSet rs = null;
Connection conn = null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:localhost", "USER", "PASSWORD");
}
catch(Exception e)
{
System.out.println("No se ha podido cargar el Driver JDBC-ODBC"); }


GRACIAS
  #2 (permalink)  
Antiguo 29/09/2006, 07:55
Avatar de stock  
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 19 años, 10 meses
Puntos: 53
tu conexion deberia ser algo asi:

Código PHP:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn DriverManager.getConnection("jdbc:odbc:NombreDelDSN"); 
y necesitas declarar tu DSN en el sistema, eso lo haces desde el panel de control....

mirate esta FAQ para mayor info:
http://www.forosdelweb.com/showpost....7&postcount=20

have funnnnn
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:25.