[code]import java.sql.;
import java.io.;
import javax.servlet.;
import javax.servlet.http.;
public class JDBCExemplo extends HttpServlet {
public JDBCExemplo() {
}
public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
throw new ServletException("Não implementado");
}
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@999.999.999.9:1521:orcl", "user", "passwd");
// Query the employee names
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("select nome from algo_tst");
// Print the name out
while (rset.next())
System.out.println (rset.getString (1));
}
}
[/code]
help-me!!!