Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <sql:query var="rs" dataSource="jdbc/mmas">
- select current_validstart as ValidTime from runoff_forecast_valid_time
- </sql:query>
- <Context path="/gs2" allowLinking="true">
- <Resource name="jdbc/mmas" type="javax.sql.Datasource"
- auth="Container" driverClassName="org.postgresql.Driver"
- maxActive="100" maxIdle="30" maxWait="10000"
- username="mmas" password="very_secure_yess_precious!"
- url="jdbc:postgresql//localhost:5432/mmas" />
- </Context>
- <resource-ref>
- <description>
- The database resource for the MMAS PostGIS database
- </description>
- <res-ref-name>
- jdbc/mmas
- </res-ref-name>
- <res-type>
- javax.sql.DataSource
- </res-type>
- <res-auth>
- Container
- </res-auth>
- </resource-ref>
- exception
- org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
- [...wads of ensuing goo elided]
- Class.forName("com.example.jdbc.Driver");
- url="jdbc:postgresql//localhost:5432/mmas"
- url="jdbc:postgresql://localhost:5432/mmas"
- $CLASSPATH << '~/.rbenv/versions/jruby-1.7.17/lib/ruby/gems/shared/gems/jdbc-postgres-9.4.1200/lib/postgresql-9.4-1200.jdbc4.jar'
- @Config
- @EnableTransactionManagement
- public class appDataConfig {
- * Other Bean Defs *
- @Bean
- public DataSource dataSource() {
- // configure and return the necessary JDBC DataSource
- DriverManagerDataSource dataSource = new DriverManagerDataSource("jdbc:oracle:thin:@//HOST:PORT/SID", "user", "password");
- dataSource.setSchema("MY_SCHEMA");
- return dataSource;
- }
- }
- @Config
- @EnableTransactionManagement
- public class appDataConfig {
- /* Other Bean Defs */
- @Bean
- public DataSource dataSource() {
- // configure and return the necessary JDBC DataSource
- OracleDataSource datasource = null;
- try {
- datasource = new OracleDataSource();
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- datasource.setURL("jdbc:oracle:thin:@//HOST:PORT/SID");
- datasource.setUser("user");
- datasource.setPassword("password");
- return datasource;
- }
- }
Add Comment
Please, Sign In to add comment