Dan,
I've been using the ejb-location with no problems. Using the Inet Sprinta
2000 driver for MS SQL.
But now I wonder if I should be using the pooled-location? What would be
the difference? Does Orion do connection pooling when using the
ejb-location?
Thanks,
Paul
Here is what my data-sources.xml looks like:
<data-source
class="com.evermind.sql.ConnectionDataSource"
name="MsSQL"
location="jdbc/MsSQLCoreDS"
pooled-location="jdbc/MsSQLPooledDS"
xa-location="jdbc/xa/MsSQLXADS"
ejb-location="jdbc/MsSQLDS"
connection-driver="com.inet.tds.TdsDriver"
username="user"
password="user"
url="jdbc:inetdae:[your ip addr]?database=[your dbname]"
inactivity-timeout="30"
/>
-----Original Message-----
From: dan moy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 07, 2000 1:25 PM
To: Orion-Interest
Subject: Re: SQL Server DB Pooling
Norman,
Thanks for your response, but I did try all of the other JNDI locations as
specified by my data-sources.xml but there was only one I could get to work;
the default location "jdbc/MyCoreDS". All other when tried return a class
cast exception error.
Any other ideas?
Thanks,
Dan
On Thu, 7 Sep 2000 12:32:12 -0700, Orion-Interest wrote:
> Orion already pools the connection for you. Just reference the pooled
> datasouce:
>
> Context ctx = new InitialContext();
> DataSource ds = (DataSource)ctx.lookup( "jdbc/pooled/MypooledDS" );
> Connection conn = ds.getConnection();
>
> This will get you a connection from the pool, and return it when you
close
> the connection.
>
> -----Original Message-----
> From: dan moy <[EMAIL PROTECTED]>
> To: Orion-Interest <[EMAIL PROTECTED]>
> Date: Thursday, September 07, 2000 12:20 PM
> Subject: SQL Server DB Pooling
>
>
> >Hello,
> >I am interested in setting up database pooling using INet's Opta driver
for
> >SQL server, but I am having trouble with the configuration.
> >
> >I can get the driver manager for single connections to work, but if I
try
> >any of the pooled conections I am getting a Cast exception.
> >
> >Any help would be appreciated! Thanks,
> >Dan
> >
> >Here is my configuration:
> >
> >
> ><data-source
> > class="com.evermind.sql.ConnectionDataSource"
> > location="jdbc/MyCoreDS"
> > pooled-location="jdbc/pooled/MypooledDS"
> > xa-location="jdbc/xa/MyXADS"
> > ejb-location="jdbc/MyDS"
> > name="My data-source"
> > url="jdbc:inetdae:SQLSERVERA:1433"
> > connection-driver="com.inet.tds.TdsDriver"
> > username="sa"
> > password=""
> >/>
> >
> >Here is the code I am using to test this connection:
> >
> >
> > PooledConnection pcon = null;
> > Connection con = null;
> > int i=0;
> >
> > System.out.println("Starting");
> > try {
> > Context ctx = new InitialContext();
> >
> >/*
> > DataSource ds = (DataSource)ctx.lookup("jdbc/MyCoreDS");
> > con = ds.getConnection();
> >*/
> > ConnectionPoolDataSource ds =
> >(ConnectionPoolDataSource)ctx.lookup("jdbc/MyDS");
> > pcon = ds.getPooledConnection();
> > con = pcon.getConnection();
> >
> > Statement s = con.createStatement();
> > ResultSet rs = s.executeQuery("select * from sysmessages");
> >
> > while (rs.next()) {
> >%>
> ><tr>
> > <td><%= i++ %></td>
> > <td><%= rs.getString(4) %></td>
> ></tr>
> ><%
> > }
> >
> > rs.close();
> > s.close();
> > }
> >
> > catch (NamingException e)
>
> > System.out.println(e.toString());
> > }
> > catch (SQLException e) {
> > System.out.println(e.toString());
> > }
> > finally
>
> > if (pcon != null)
> > try {
> > pcon.close();
> > }
> > catch(Exception e) {
> > System.out.println(e.toString());
> > }
> > }
> >
> >
> >
> >
> >
> >
> >
> >
> >_______________________________________________________
> >Say Bye to Slow Internet!
> >http://www.home.com/xinbox/signup.html
> >
>
>
_______________________________________________________
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html