openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ba3fcf36ee0f06e80cb807d7d0e39d69b5e0eef6
parent a36da371df697c36657972be4f8145374c4b7576
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 12 Jan 2018 23:09:38 +0100

Nicht mehr notwendig, da Oracle keine unterstützte Datenbank ist.

Diffstat:
doc/examples/jdbc/context.xml | 29-----------------------------
doc/examples/jdbc/dbtest.jsp | 45---------------------------------------------
2 files changed, 0 insertions(+), 74 deletions(-)

diff --git a/doc/examples/jdbc/context.xml b/doc/examples/jdbc/context.xml @@ -1,28 +0,0 @@ -<!-- Sample context.xml for Tomcat Servlet Engine --> -<Context> - - <!-- Default set of monitored resources --> - <WatchedResource>WEB-INF/web.xml</WatchedResource> - - <!-- Beware: You must download the JARs with the database - driver an place them in Tomcats lib-directory --> - - <!-- Sample Oracle Datasource --> - <Resource name="jdbc/myoracledb" auth="Container" - type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" - url="jdbc:oracle:thin:@localhost:1521:name" - username="dbuser" password="dbpassword" maxActive="20" maxIdle="10" - maxWait="-1"/> - - <!-- Sample SQlite Datasource --> - <Resource name="jdbc/mysqlitedb" auth="Container" - type="javax.sql.DataSource" driverClassName="org.sqlite.JDBC" - url="jdbc:sqlite://path/to/mydb.db" /> - - <!-- Sample PostgreSQL Datasource --> - <Resource name="jdbc/mypostgresqldb" auth="Container" - type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" - url="jdbc:postgresql://127.0.0.1:5432/mydb" - username="dbuser" password="dbpass" maxActive="20" maxIdle="10" maxWait="-1"/> - -</Context>- \ No newline at end of file diff --git a/doc/examples/jdbc/dbtest.jsp b/doc/examples/jdbc/dbtest.jsp @@ -1,45 +0,0 @@ -<html> -<title>Simple Database-Test for JDBC</title> -<body> - -<%@ page import="java.sql.*" isThreadSafe="false" %> -<%@ page import="javax.sql.*" isThreadSafe="false" %> -<%@ page import="javax.naming.*" isThreadSafe="false" %> - -<% - - final String jndiName = "java:comp/env/jdbc/mysampledb"; - Connection cn = null; - Statement st = null; - ResultSet rs = null; - try - { - InitialContext ctxt = new InitialContext(); - DataSource ds = (DataSource) ctxt.lookup(jndiName); - cn = ds.getConnection(); - st = cn.createStatement(); - rs = st.executeQuery( "select id,name from or_user" ); - ResultSetMetaData rsmd = rs.getMetaData(); - int n = rsmd.getColumnCount(); - out.println( "<table border=1 cellspacing=0><tr>" ); - for( int i=1; i<=n; i++ ) // Achtung: erste Spalte mit 1 statt 0 - out.println( "<th>" + rsmd.getColumnName( i ) + "</th>" ); - while( rs.next() ) - { - out.println( "</tr><tr>" ); - for( int i=1; i<=n; i++ ) // Achtung: erste Spalte mit 1 statt 0 - out.println( "<td>" + rs.getString( i ) + "</td>" ); - } - out.println( "</tr></table>" ); - } - finally - { - try { if( null != rs ) rs.close(); } catch( Exception ex ) {} - try { if( null != st ) st.close(); } catch( Exception ex ) {} - try { if( null != cn ) cn.close(); } catch( Exception ex ) {} - } -%> - -</body> -</html> -