JSP reading Oracle Tables...

Can JSP read Oracle tables? I've seen stuff like this done in ASP.NET, but I'm completely unfamiliar with using JSP/Java to connect to an Oracle Database and read-in information and send Queries and use results from those in outputs. Is there a place I can grab some APIs for doing this or examples??

Who is Participating?
KruleConnect With a Mentor Commented:
A JSP page can (almost) do everything that a Java class can do, although it shouldn't.

If you want to do this the quick'n'dirty way, there is a set of JSP Tag Libraries that allow you to connect to a database, define an SQL query and execute it, and then use the rows for processing in your jsp page. You can find that here: http://jakarta.apache.org/taglibs/doc/dbtags-doc/intro.html with documentation here: http://jakarta.apache.org/taglibs/doc/dbtags-doc/dbtags-1.0/index.html and the binaries necessary here: http://jakarta.apache.org/site/downloads/downloads_taglibs-dbtags.cgi

If you are looking for an alternative solution, I would suggest calling a servlet that does your processing for you (Using something of this nature: http://javaalmanac.com/egs/java.sql/ConnectOracle.html )

Hope this helps
mmarksburyConnect With a Mentor Commented:
Like ASP.NET, you need to use the objects that JAVA provides for data access.

Driver DriverObj = (Driver)Class.forName("Insert Driver String").newInstance();
Connection ConnectionObj = DriverManager.getConnection("ConnectionString", "UsernameString", "PasswordString");
PreparedStatment StatementObj = ConnectionObj.prepareStatement("SELECT * FROM SOMETABLE");
ResultSet ResultsObj = StatementObj.executeUpdate();

  // Fun Stuff

That should help get you started.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.