1. How can I spoof a jndi lookup for a datasource without a app server stackoverflow.comI want to test some new functionality which is part of an internal web app. This new code uses a database connection normally provided by an app server (tomcat). I do not ... |
2. Context specific usernames for connections on a JEE Datasource (JBoss 5.1) stackoverflow.comWe have an application that needs to access a database that is owned by a different team. That database has security inside the database (triggers, table permissions, etc) and so we need ... |
3. Object persistence terminology: 'repository' vs. 'store' vs. 'context' vs. 'retriever' vs. (...) stackoverflow.comI'm not sure how to name data store classes when designing a program's data access layer (DAL). (By data store class, I mean a class that is responsible to read a persisted ... |
4. How can I switch the database context of an existing DataSource? stackoverflow.comLet's say I have an existing DataSource to a master database. I now need to create a new database, and execute some DDLs on that database. Is this possible with e.g, ... |
5. lookup datasource in context every time, Is it right? stackoverflow.comIn my application i configured more than one datasource (for diff databases). Whenever user sends a request depends upon user category i need to look up for the respective datasource in ... |
6. Getting Datasource from Context coderanch.com |
7. Errored while looking up datasource: PWC4216: Name jdbc is not bound in this Context coderanch.com//looks up a datasource private static synchronized DataSource getDataSource(String jndiName) throws NamingException { DataSource dataSource = null; try { Context c = new InitialContext(); Context envContext = (Context) c.lookup("java:comp/env"); Logger.getLogger(DBUtilities.class.getName()).log(Level.INFO, "Found sub context"); dataSource = (DataSource) envContext.lookup(jndiName); } catch (NamingException e) { e.printStackTrace(); throw new NamingException("Errored while looking up datasource: " + e.getMessage()); } return dataSource; } |
8. Getting Remote Datasource object to client using Weblogic Context Factory from remote Machine coderanch.comI've written a simple java class in my client machine to get jdbc datasource using weblogic jndi context created in weblogic server which is hosted in remote machine. I'm facing a small problem to get this datasource object. Can any one please help to sort it out? I've included the below list of jars in my classpath. Please let me know ... |
9. How to bind DataSource using context.bind. Connection pooling etc. coderanch.com |
10. ClassCastException getting Datasource from Context java-forums.orgpackage connections; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Properties; import javax.naming.Context; import javax.naming.InitialContext; import javax.sql.DataSource; public class TestJNDI { public static void main(String[] args) { Properties p = new Properties(); p.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" ) ; p.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" ) ; p.setProperty("java.naming.provider.url","jnp://192.168.15.22:6578") ; try { Context ctx = null; ctx = new InitialContext(p); DataSource _dataSource = (DataSource) ctx.lookup("MY_POOL"); Connection dbConn = _dataSource.getConnection(); System.out.println(dbConn.getTransactionIsolation()); ... |