How can I get the Connection in JSF?

Hello,The code below is not working.Connection conn = tblusersRowSet.getConnection();Statement stmt = conn.createStatement();ResultSet results = stmt.executeQuery(query);How can I use a current connection in jCreator?ThanksFrank
[284 byte] By [Fast_Franka] at [2007-11-26 12:20:56]
# 1
try this:String dsn = tableDataProvider.getCachedRowSet().getDataSourceName();InitialContext ctx = new InitialContext();DataSource ds = (DataSource)ctx.lookup(dsn);Connection con=ds.getConnection();
discusfisha at 2007-7-7 15:11:46 > top of Java-index,Archived Forums,Socket Programming...
# 2
Thank you, that worked link a charm.Why did my code fail?Was it because the connection was closed?Frank
Fast_Franka at 2007-7-7 15:11:46 > top of Java-index,Archived Forums,Socket Programming...