Does this mean I can only use the DataSource from within a
Servlet/JSP/EJB????

Alan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of danch (Dan
Christopherson)
Sent: 20 June 2001 19:49
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Cannot connect to java:/SQLServerPool


The connections are only available within the JBoss process.

Alan McDade wrote:

> Hi All
>
> Having trouble creating a connection. I'm sure this question has been
asked
> a dozen times but I cannot search the archives at the moment cause they
are
> not working.
>
> I have managed to install a jdbc-odbc connection to the companies sql
> server.
>
> ...
> [JDBC provider] Loaded JDBC-driver:org.hsql.jdbcDriver
> [JDBC provider] Loaded JDBC-driver:org.enhydra.instantdb.jdbc.idbDriver
> [JDBC provider] Loaded JDBC-driver:sun.jdbc.odbc.JdbcOdbcDriver
> ...
> [SQLServerPool] Starting
> [SQLServerPool] XA Connection pool SQLServerPool bound to
> java:/SQLServerPool
> [SQLServerPool] Started
> ...
>
> The code I am using to create a connection is as follows...
>
> /*
>  * DSConnection.java
>  *
>  * Created on 20 June 2001, 17:37
>  */
>
> import java.util.Properties;
> import javax.naming.*;
> import javax.sql.*;
>
> /**
>  *
>  * @author  alanM
>  * @version
>  */
> public class DSConnection {
>
>     /** Creates new DSConnection */
>     public DSConnection() {
>     }
>
>     /**
>     * @param args the command line arguments
>     */
>     public static void main (String args[])
>     {
>         Properties env = new Properties();
>         env.setProperty("java.naming.factory.initial",
> "org.jnp.interfaces.NamingContextFactory");
>         env.setProperty("java.naming.provider.url",  "localhost:1099");
>
>       try
>
>
>             // Get a naming context
>             InitialContext jndiContext = new InitialContext(env);
>             System.out.println("Got context");
>
>             javax.sql.DataSource source =
> (javax.sql.DataSource)jndiContext.lookup("java:/SQLServerPool");
>
>       }
>       catch(Exception e)
>
>
>             e.printStackTrace();
>       }
>     }
> }
>
> However whenever I run the code I get the following exception
>
> javax.naming.NameNotFoundException: SQLServerPool not bound
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>



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


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

Reply via email to