1 Reply Latest reply on Mar 4, 2008 6:26 PM by jimk1723

    JDBC connection

    marx3

      Hello
      how to get JDBC Connection in Seam Component (or in EJB)?
      I don't need transaction, I need to only read some data

        • 1. Re: JDBC connection
          jimk1723

          Have you run into problems with just using JNDI?


          InitialContext initialContext = new InitialContext();
          javax.sql.DataSource ds = (javax.sql.DataSource) initialContext.lookup(datasourcejndiname);
          Connection c = ds.getConnection();