From: <MSe...@so...> - 2002-10-09 14:52:27
|
OK. I use this on JBoss 2.4 and WebSphere : //Restoring connection from pool dataSource = (DataSource)ServiceLocator.getServiceLocator ().getJndiService(jndiDataSourceName); connection = dataSource.getConnection(); //Setting NLS ... setConnectionParams(connection); where : dataSource is instance of javax.sql.DataSource connection is instance of java.sql.Connection later : connection.executeUpdate("INSERT ...... NLS specific values Everything works OK. But when I try to use JBoss 3.0.2, it doesn't work - NLS params are not set, when I use the restored connection later - that's the problem. So I just wanted to know, how to set NLS params or any other params for the restored connection. Something must have been changed in the implementation of JBoss connection pool, 'cause it works other way now. And the getUnderlyingConnection method didn't help. Thanks Marek David Jencks <davidjencks@directvinternet To: jbo...@li... .com> cc: (bcc: Marek Sedliak/BYS/SOFTIP) Sent by: Subject: Re: [JBoss-user] Initializing JDBC Connection II jbo...@li...urc eforge.net 09.10.2002 14:38 Please respond to jboss-user On 2002.10.09 04:22:26 -0400 MSe...@so... wrote: > > Hi David, > > thank you for you're helping me. I have tried to do this : > > org.jboss.resource.adapter.jdbc.local.LocalConnection loJBossConnection > = (org.jboss.resource.adapter.jdbc.local.LocalConnection)aoConnection; > oracle.jdbc.driver.OracleConnection oraConn > = (oracle.jdbc.driver.OracleConnection)loJBossConnection.getUnderlyingConnection > > ); > setNLSParams(oraConn); //- sets the NLS params on the connection > > But id doesn't help - when I try to insert date into DB it fails. The > only > way how it works now is to set NLS everytime before INSERT. In the > previous > version of JBoss it was OK to set NLS after getting connection from pool. I't isn't clear to me what the difference is between the code that works and the code that doesn't work. david jencks > > Thank you very much. > > Marek > > > > > > David Jencks > > <davidjencks@directvinternet To: > jbo...@li... > .com> cc: (bcc: > Marek Sedliak/BYS/SOFTIP) > Sent by: Subject: Re: > [JBoss-user] Initializing JDBC Connection II > jbo...@li...urc > > eforge.net > > > > > > 08.10.2002 19:54 > > Please respond to jboss-user > > > > > > > > > > I'ts an optional adapter, not part of jboss core. It's in the > jboss-local-jdbc.rar. > > david jencks > > > On 2002.10.08 12:31:57 -0400 MSe...@so... wrote: > > > > Hi David, > > > > thanks. I tried that, but jboss-jca.jar has no class in package > > org.jboss.resource.adapter.jdbc.local. I use JBoss 3.0.2 - could this > be > > a > > problem ? Do I have to uprade JBoss ? > > > > Thank you. > > > > Marek > > > > > > > > > > > > David Jencks > > > > <davidjencks@directvinternet To: > > jbo...@li... > > .com> cc: (bcc: > > Marek Sedliak/BYS/SOFTIP) > > Sent by: Subject: > Re: > > [JBoss-user] Initializing JDBC Connection II > > jbo...@li...urc > > > > eforge.net > > > > > > > > > > > > 07.10.2002 21:04 > > > > Please respond to jboss-user > > > > > > > > > > > > > > > > > > > > On org.jboss.resource.adapter.jdbc.local.LocalConnection in 3.0.x and > 3.2 > > > > david jencks > > > > On 2002.10.05 09:53:59 -0400 MSe...@so... wrote: > > > > > > Hi David. > > > > > > Thank you very much for your help. > > > But I still have a little problem - do you mean method > > > getUnderlyingConnection on tyrex.resource.jdbc.xa.TyrexConnection > > > instance > > > ? But it has a private access. > > > > > > > > > More details : > > > > > > On JBoss 2.4 I used something like this : > > > > > > //Restoring connection from pool > > > dataSource = (DataSource)ServiceLocator.getServiceLocator > > > ().getJndiService(jndiDataSourceName); > > > connection = dataSource.getConnection(); > > > > > > //Setting NLS ... > > > setConnectionParams(result); > > > > > > where : > > > > > > dataSource is instance of javax.sql.DataSource > > > connection is instance of java.sql.Connection > > > > > > and setConnectionParams performs setting NLS_LANGUAGE, NLS_TERRITORY > > and > > > NLS_SORT, NLS_DATE_FORMAT on the restored connection. > > > > > > > > > In previous JBoss version it worked OK, but now it doesn't. > > > > > > > > > Thank you. > > > > > > Marek > > > > > > > > > > > > > > > > > > > > > > > > David Jencks > > > > > > <davidjencks@directvinternet To: > > > jbo...@li... > > > .com> cc: (bcc: > > > Marek Sedliak/BYS/SOFTIP) > > > Sent by: Subject: > > Re: > > > [JBoss-user] Initializing JDBC Connection II > > > jbo...@li...urc > > > > > > eforge.net > > > > > > > > > > > > > > > > > > 05.10.2002 13:45 > > > > > > Please respond to jboss-user > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > If you are doing this on a connection by connection basis, you would > > need > > > to get the underlying connection > > > > > > OracleConnection oc = (OracleConnection)c.getUnderlyingConnection(); > > > > > > If this isn't what you want provide more details. > > > > > > david jencks > > > > > > On 2002.10.05 06:53:41 -0400 MSe...@so... wrote: > > > > Hi all, > > > > > > > > please, I would like to ask you about initializing JDBC connection > - > > > I > > > > mean, I need to set up a few connection params that are application > > > > specific, e.g. for ORACLE - NLS_LANGUAGE, NLS_TERRITORY and > > NLS_SORT, > > > > NLS_DATE_FORMAT. I have found in the archive it's a problem now. In > > > JBoss > > > > 2.4 it worked after getting the connection from the pool. In JBoss > > 3.0 > > > it > > > > doesn't. > > > > Please, is there any correct way how to set up these params ? > > > > > > > > Thanks a lot. > > > > > > > > Marek > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This sf.net email is sponsored by:ThinkGeek > > > > Welcome to geek heaven. > > > > http://thinkgeek.com/sf > > > > _______________________________________________ > > > > JBoss-user mailing list > > > > JBo...@li... > > > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > JBoss-user mailing list > > > JBo...@li... > > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by:ThinkGeek > > > Welcome to geek heaven. > > > http://thinkgeek.com/sf > > > _______________________________________________ > > > JBoss-user mailing list > > > JBo...@li... > > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > JBoss-user mailing list > > JBo...@li... > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > JBoss-user mailing list > > JBo...@li... > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > JBo...@li... > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > JBo...@li... > https://lists.sourceforge.net/lists/listinfo/jboss-user > > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list JBo...@li... https://lists.sourceforge.net/lists/listinfo/jboss-user |