/**
 * 
 */
package org.apache.camel.component.jdbc;

import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import javax.sql.DataSource;

/**
 * TODO Provide description for TestDataSource.
 * 
 * @author <a href="mailto:nsandhu@raleys.com">nsandhu</a>
 *
 */
public class TestDataSource implements DataSource{
    private String url, username, password;
    public TestDataSource(String url, String user, String password){
        this.url=url;
        this.username=user;
        this.password=password;
    }
    
    public Connection getConnection() throws SQLException {
        return DriverManager.getConnection(url, username, password);
    }

    public Connection getConnection(String username, String password) throws SQLException {
        return DriverManager.getConnection(url, username, password);
    }

    public int getLoginTimeout() throws SQLException {
        return DriverManager.getLoginTimeout();
    }

    public PrintWriter getLogWriter() throws SQLException {
        return DriverManager.getLogWriter();
    }

    public void setLoginTimeout(int seconds) throws SQLException {
       DriverManager.setLoginTimeout(seconds);
    }

    public void setLogWriter(PrintWriter out) throws SQLException {
        DriverManager.setLogWriter(out);
    }

}

/**
 * 
 */
package org.apache.camel.component.jdbc;

import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import javax.sql.DataSource;

/**
 * TODO Provide description for TestDataSource.
 * 
 * @author <a href="mailto:nsandhu@raleys.com">nsandhu</a>
 *
 */
public class TestDataSource implements DataSource{
    private String url, username, password;
    public TestDataSource(String url, String user, String password){
        this.url=url;
        this.username=user;
        this.password=password;
    }
    
    public Connection getConnection() throws SQLException {
        return DriverManager.getConnection(url, username, password);
    }

    public Connection getConnection(String username, String password) throws SQLException {
        return DriverManager.getConnection(url, username, password);
    }

    public int getLoginTimeout() throws SQLException {
        return DriverManager.getLoginTimeout();
    }

    public PrintWriter getLogWriter() throws SQLException {
        return DriverManager.getLogWriter();
    }

    public void setLoginTimeout(int seconds) throws SQLException {
       DriverManager.setLoginTimeout(seconds);
    }

    public void setLogWriter(PrintWriter out) throws SQLException {
        DriverManager.setLogWriter(out);
    }

	public boolean isWrapperFor(Class<?> iface) throws SQLException {
		// TODO Auto-generated method stub
		return false;
	}

	public <T> T unwrap(Class<T> iface) throws SQLException {
		return null;
	}

}

Make it compile even on java 1.6
Make it compile even on java 1.6


git-svn-id: e3ccc80b644512be24afa6caf639b2d1f1969354@573348 13f79535-47bb-0310-9956-ffa450edef68
