Hi,
You are using a highly inappropriate method for getting a connection in an
enterprise application. Normally one uses pooled connections in an ejb
container. I suggest you read the jboss documentation concentrating on the
howtos on MSSQL and Richard Monson-Haefel's examples. I believe he
includes an example of db access through a stateless session bean. Richard
Monson Haefel's book is also in my opinion very good.
Basically you should be looking up a datasource via jndi, and getting a
connection from it. This datasource should be handing out connections from
pooled XAConnections, but you don't need to code that part... thats one of
the services provided by the container.
If you want to get connections directly from the driver manager, I can't
offhand think of any reason to use ejb's in the first place.
david jencks
On 2001.05.03 12:57:56 -0400 Cumps Jef wrote:
> Hi all,
>
> I'm trying to query a MS SQL database in a stateless session bean, using
> the following code:
>
> String myDriver = "com.inet.tds.TdsDriver";
> String url = "jdbc:inetdae7://onuris.groept.be?database=JFK_CarTracker";
> String loginname = "710521079";
> String password = "710521079";
> Class.forName(myDriver);
> Connection con = DriverManager.getConnection(url,loginname,password);
>
> I've put the jar file from the driver in my classpath.
>
> I'm getting a ClassCasException on the forName()-command. Does anyone has
> an idea why ?????
>
> any help would be really appreciated!!
> Jef
>
> _______________________________________________
> 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