This content has been marked as final.
Show 1 reply
-
1. Re: Scheduler and JNDI
carbonch Apr 10, 2006 1:02 PM (in response to msqrt84)Are you looking for this piece of code?
// get data base connection Context ctx = new InitialContext(); DataSource ds = (DataSource) ctx.lookup("java:/MyDS"); conn = ds.getConnection(); // get data base driver Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); // Execute the select pstmtSelect = conn.prepareStatement("SELECT * FROM MyTable"); ResultSet rs = pstmtSelect.executeQuery();
Regards,
Reto