how i can create a datasource in java code when i have connection url?

Hithank you for reading my post.is there any way to create a datasource in java code when we have connection ur?indeed i should create a datasource to pass it to some data provider class and i can not use application server datasource mechanism.thanks.
[287 byte] By [Legolas.wa] at [2007-11-26 19:26:28]
# 1
Create your own class that implements the DataSource interface.
masijade.a at 2007-7-9 21:51:49 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html
zadoka at 2007-7-9 21:51:49 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

can you pleas tell me how i can implement some of its methods?

I know about impementing getConnection but not the other stuff.

public PrintWriter getLogWriter() throws SQLException {

return new PrintWriter(System.out);

}

public void setLogWriter(PrintWriter out) throws SQLException {

}

public void setLoginTimeout(int seconds) throws SQLException {

}

public int getLoginTimeout() throws SQLException {

}

thanks

Legolas.wa at 2007-7-9 21:51:49 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

All of those depend on the logger you are using (if any) or the configuration of your Driver.

Read your driver documentation to see how you set the timeout for your connection attempt (for the setTimeout). The others can easily be handled with simple instance variables. Think about it for a moment. All of those methods are simple getter/setter methods.

masijade.a at 2007-7-9 21:51:49 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...