2 Replies Latest reply on Jun 16, 2003 12:00 PM by jfradkin

    JDBC Help?

    jfradkin Newbie

      I am new to both Jboss and Java.
      I have written 3 applications so far and used the MSSQL driver with no problems. I am getting started on a major re-write of our ASP app and have figured out I should use pooled conection over the device method I use now. I tried configureing the MSSQLDS xml file and removed the default hypersonic xml file.
      My hope is to use enterprise beans for data conectivity and servlets (Velocity front end) for client.
      I can not even get the JNDI name thing going and am brain dead. I did buy the doco for Jboss and several books, but am just not gettig a working model of pooling. Is there a example that explains it in simple way from the ground up. I asume that Jboss is the only server I need, I am using jboss-3.2.1_tomcat-4.1.24 version and eclipse. I got Velocity going and can use the non pooled conection, but would rather learn the basics any examples appreciated. I did read the JNDI sun tutorial, but it left me going DOh. DO I need Ldap to get JDBC going? I keep getting need to define class in env. I tried a few of the examples on the forum, but figure I must be missing something basic.

      Thanks Joel

        • 1. Re: JDBC Help?
          jfradkin Newbie

          more specifics in jdbc forum (have my mssql-ds.xml included)

          I tried deleting all java installs (I did have an old directory) and re-installing as I read this had to do with more then one install, but I should be clean.

          Works fine with.
          Connection con1 = DriverManager.getConnection(url, username, password);
          Statement stmt = con1.createStatement();

          blows up on
          Context ctx = new InitialContext();
          DataSource ds = (DataSource)ctx.lookup("java:/MSSQLDS");
          con = ds.getConnection();

          javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

          • 2. Re: JDBC Help?
            jfradkin Newbie

            I figured it out I needed more client libs to get jndi working. I ended up using ds config from an example on this forum to get the connection happy. I am sure I am including more libs then I need but I did not see the exact combo and once I knew that was the issue I just included all the ones from jboss client.

            Jope this helps, more detail under JDBC forum.