jndi

Weblogic 10.1 配置JNDI 数据源

。_饼干妹妹 提交于 2019-11-29 16:24:23
一 . JNDI 连接的使用原理: 1.1 在设计器中先用 JDBC 连接到数据库,建立数据库连接,然后用 SQL 或者其他方法创建数据集,使用数据集制作好 报表 ,然后把建立的数据库连接从 JDBC 连接改成 JNDI 连接,保存模板,并部署至 weblogic 服务器。 1.2 服务器端配置数据源。 1.3 修改应用 WEB-INF 下的 web.xml 文件 这样就可以通过 WEB 浏览器浏览到使用 JNDI 数据源的 报表 了。 二 . 我们以 oracle 10g 数据源制作的模板 jndi.cpt 为例来说明 2.1 设计器制作报表: l 在设计器中用 JDBC 连接到 oracle 10g 数据库,使用数据库中的数据表 student 制作如下模板 jndi.cpt : http://www.finereport.com/forumimages/w-formwork.jpg l 回到定义数据连接面板,将先前定义的数据库连接变为 JNDI 连接,设置 JNDI 的名字为 oracle http://www.finereport.com/forumimages/w-link1.jpg http://www.finereport.com/forumimages/w-link2.jpg l 保存模板至 weblogic 10 的应用目录 WebReport/WEB-INF

[转]Spring引用Tomcat的 JTA事务

怎甘沉沦 提交于 2019-11-29 16:22:40
Spring引用Tomcat的 JTA 事务 Tomcat是Servlet容器,但它提供了JNDI的实现,因此用户可以象在Java EE应用程序服务器中一样,在Tomcat中使用JNDI查找JDBC数据源。在事务处理方面,Tomcat本身并不支持 JTA ,但是可以通过集成JOTM达到目的。 如果你的应用最终部署到一个功能齐备的Java EE应用服务器上,也许你更希望使用Java EE应用服务器的 JTA 功能,这样可以利用应用服务器本身许多优化措施。下面,我们让Tomcat通过JNDI开放JOTM的 JTA 的数据源,进而在Spring容器引用这个JNDI数据源,并在此基础上提供 JTA 事务。我们所使用的环境是:Tomcat 5.5+JOTM 2.3。 1. 添加所需的JAR文件 将JOTM以下类包添加到<Tomcat安装目录>/common/lib目录中: jotm.jar jotm_jrmp_stubs.jar jotm_iiop_stubs.jar ow_carol.jar jta -spec1_0_1.jar jts1_0.jar objectweb-datasource.jar xapool.jar howl.jar connector-1_5.jar 同时,还需要添加相应数据库的JDBC驱动类包,例如 MySQL 的 mysql .jar。 2. 配置JOTM

Spring引用Tomcat的 JTA事务

余生长醉 提交于 2019-11-29 16:22:27
Spring引用Tomcat的 JTA事务 Tomcat是Servlet容器,但它提供了JNDI的实现,因此用户可以象在Java EE应用程序服务器中一样,在Tomcat中使用JNDI查找JDBC数据源。在事务处理方面,Tomcat本身并不支持JTA,但是可以通过集成JOTM达到目的。 如果你的应用最终部署到一个功能齐备的Java EE应用服务器上,也许你更希望使用Java EE应用服务器的JTA功能,这样可以利用应用服务器本身许多优化措施。下面,我们让Tomcat通过JNDI开放JOTM的JTA的数据源,进而在Spring容器引用这个JNDI数据源,并在此基础上提供JTA事务。我们所使用的环境是:Tomcat 5.5+JOTM 2.3。 1. 添加所需的JAR文件 将JOTM以下类包添加到<Tomcat安装目录>/common/lib目录中: jotm.jar jotm_jrmp_stubs.jar jotm_iiop_stubs.jar ow_carol.jar jta-spec1_0_1.jar jts1_0.jar objectweb-datasource.jar xapool.jar howl.jar connector-1_5.jar 同时,还需要添加相应数据库的JDBC驱动类包,例如MySQL的mysql.jar。 2. 配置JOTM 新建一个carol

Inject a file using @Resource and JNDI in JEE6

寵の児 提交于 2019-11-29 16:20:31
Is it possible to inject a file using JNDI and @Resource in JEE6? If so how do I setup and JNDI (file) resource in Glassfish? If your objective is to configure a properties file as follows: @Inject @Resource("META-INF/aws.properties") Properties awsProperties; then you want to use a WELD extension which is explained in the WELD documentation here It is as simple as adding this to your POM <dependency> <groupId>org.jboss.weld</groupId> <artifactId>weld-extensions</artifactId> <version>${weld.extensions.version}</version> <type>pom</type> <scope>import</scope> </dependency> Otherwise See this

What is a validationQuery with respect to databases and JNDI?

孤街浪徒 提交于 2019-11-29 14:22:21
I seem to be having the same exact problem as the poster of this original SO question . The problem is, he answered his own question with the following comment: I solved my problem, I added a validationQuery to my JNDI datasource. Unfortunately, that doesn't mean anything to me, and doesn't help me solve my problem. So I ask: what is a " validationQuery " with respect to my database (Sybase) and the JNDI entry used to hold the server lookup info? Thanks in advance. rgettman The validation query is a query run by the data source to validate that a Connection is still open before returning it.

Portable JNDI Syntax lookup for EJB on Glassfish

自作多情 提交于 2019-11-29 13:02:28
Previous attempts were to have Netbeans deploy an EJB module , which builds as a JAR rather than an EAR, onto the Glassfish server which Netbeans has access to. However, deploying that JAR to Glassfish through the CLI with asadmin possibly runs into a bug . The EAR deploys through the CLI without issue -- however, the JNDI names for the EJB doesn't appear to work. What is the discrepancy? 32.4.1.1 Portable JNDI Syntax Three JNDI namespaces are used for portable JNDI lookups: java:global, java:module, and java:app. The java:global JNDI namespace is the portable way of finding remote enterprise

ldap search is very slow

て烟熏妆下的殇ゞ 提交于 2019-11-29 12:04:38
I am using JNDI to connect to the LDAP active directory, and I want to search for users where the name contains the search string, so my search method is as follows: public static List<LDAPUser> searchContactsByName( ExtendedDirContext extendedDirContext, String name) { try { LdapContext ldapContext = extendedDirContext.getLdapContext(); String searchBaseStr = extendedDirContext.getSearchBase(); String sortKey = LDAPAttributes.NAME; ldapContext.setRequestControls(new Control[] { new SortControl( sortKey, Control.CRITICAL) }); SearchControls searchCtls = new SearchControls(); searchCtls

JBoss: Binding values into JNDI in JBoss EAP 6 similar to JNDIBindingServiceMgr

人盡茶涼 提交于 2019-11-29 11:53:05
How do I bind an arbitrary string to JNDI in JBoss EAP 6? I used to do it through org.jboss.naming.JNDIBindingServiceMgr MBean in previous EAP version. Is there anything similar to org.jboss.naming.JNDIBindingServiceMgr in JBoss EAP 6? We are migrating applications from jboss-5.1.EAP to jboss-eap-6.1. We need to bind some things into JNDI, so applications can look up values of environment variables. Many thanks. You can do the following: standalone.xml: <subsystem xmlns="urn:jboss:domain:naming:1.2"> <bindings> <simple name="java:global/user" value="newUser"/> </bindings> </subsystem> and in

Spring Boot Using Embedded Tomcat with JNDI

╄→尐↘猪︶ㄣ 提交于 2019-11-29 11:42:39
I am using Spring Boot with Embedded Tomcat and attempting to use JNDI but getting the following error: javax.naming.NameNotFoundException: Name [jdbc/dataSource] Any tips would be greatly appreciated. Here is my code: @Configuration public class TomcatJndiConfiguration{ @Value("${database.driver}") private String driverClassName; @Value("${database.url}") private String databaseUrl; @Value("${database.username}") private String databaseUsername; @Value("${database.password}") private String databasePassword; @Bean public TomcatEmbeddedServletContainerFactory tomcatFactory() { return new

Cannot create JDBC driver of class '' for connect URL 'null'

流过昼夜 提交于 2019-11-29 11:32:09
问题 I'm using Tomcat 7.0.12 and receiving this error whenever I attmept to access a JNDI datasource connecting to a postgresql db via a .jsp page in a webapp called 'ROOT': SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [java.lang.RuntimeException: Cannot create JDBC driver of class '' for connect URL 'null'] with root cause java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver