TulKaSCl Posted April 25, 2014 Report Share Posted April 25, 2014 necesito mostrar una tabla (Productos) creada en oracle database, en una pagina JSP, he hecho el codigo pero al correr la aplicacion me aparce un error 500. mi codigo es el siguiente. (no se si estoy haciendo bien la conexion de netbeans a oracle database, quizas eso sea el problema, si alguien me puede hechar una mano, se le agradeceria enormemente).: obviamente con la tabla ya creada (productos) ejecuto el siguiente codigo y no me muestra los datos si no que me muesra un error 500 al saltar a esta pagina.<%@page contentType="text/html" pageEncoding="UTF-8"%><%@ page import="java.sql.*" %><% Class.forName("oracle.jdbc.driver.OracleDriver"); %> <!DOCTYPE html><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>Productos</h1> <% Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "DAVID", "DAVID"); Statement statement = connection.createStatement() ; ResultSet resultset = statement.executeQuery("select * from Producto") ; %> <TABLE BORDER="1"> <TR> <TH>Id Producto</TH> <TH>Nombre de Producto</TH> <TH>stock de producto</TH> </TR> <% while(resultset.next()){ %> <TR> <TD> <%= resultset.getString(1)%> </TD> <TD> <%= resultset.getString(2)%> </TD> <TD> <%= resultset.getString(3)%> </TD> </TR> <% } %> </TABLE> </body></html> Link to comment Share on other sites More sharing options...
AshWilliams Posted April 26, 2014 Report Share Posted April 26, 2014 Y que te sale en la pestaña network, cuando presionas F12 en Chrome?? :tonto: PS: Pon un pantallazo :) Link to comment Share on other sites More sharing options...
TulKaSCl Posted April 26, 2014 Author Report Share Posted April 26, 2014 http://www.subirimagenes.net/i/140426025854828411.jpg Link to comment Share on other sites More sharing options...
AshWilliams Posted April 26, 2014 Report Share Posted April 26, 2014 Te faltó incluir el driver pos :tonto: PS: Sigue estas instrucciones manito : http://stackoverflow.com/questions/13904103/java-lang-classnotfoundexception-oracle-jdbc-driver-oracledriver Saludines Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now