Hi,

  How I can access a database from a connection ?
  Looking at the j2ee connector spec I can find the
first steps to do this connection are :

      Context initctx = new InitialContext();
      ConnectionFactory cfx = (ConnectionFactory)
initctx.lookup("java:/DefaultDS");
      javax.resource.cci.Connection cx =
cfx.getConnection();

  Ok. But how I can use this cx variable to get a
java.sql.Connection to then make my database calls ?

      java.sql.Connection con = ???;
      Statement st = con.createStatement();
      java.sql.ResultSet rs = st.executeQuery("SELECT
* from employee");
      while (rs.next()) {
        ...
      }
      st.close();
      con.close();
      cx.close();

  TIA.

  Andre S.

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to