Non nobis Domine...

Search


Calendar

« octubre 2008
lunmarmiéjueviesábdom
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Hoy

















KITARO lyrics





Nube de tags del Blog

10.1.3.1 2008 calendario consejos curiosidades datasource documentacion eclipse ejemplo emergente expressions generics ide install java javahispano ldap libro libros oas opensolaris oracle recomendacion recursividad regulas roller spring swing test tips weblogicserver webstack

Data Source en OAS 10.1.3.1

mayo 06, 2008 by Isaac Ruiz Guerra

Me encuentro haciendo algunas cosas en el OAS 10.1.3.1. - ahora entiendo la razón de la compra de BEA  XD  -

Y he requerido acceder a un dataSource, aquí les dejo el código por si le sirve a a alguien.


 

         try {
            InitialContext initContext = null;
            Hashtable ht = new Hashtable();            
            ht.put(Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory");
            ht.put(Context.PROVIDER_URL, "http:ormi://localhost:8888");
            ht.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
            ht.put(Context.SECURITY_CREDENTIALS, "mypassword");
            initContext = new InitialContext(ht);
            System.out.println("Name in space"+ initContext.getNameInNamespace());
            javax.sql.DataSource dataSource = (javax.sql.DataSource) initContext.lookup("jndi/MySQLDS");
            System.out.println("Data Source cargado sin problemas");
        } catch (NamingException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }

 

 

Asegúrense de tener en el classpath el jar: oc4jclient.jar ubicado en: <OAS>oc4j/j2ee/home/ 

Saludos... 

RuGI

Isaac Ruiz Guerra. 

 

 

Configurar un DS en Spring para WebLogic

julio 29, 2007 by Isaac Ruiz Guerra

La verdad me costó un par de horas encontrar esta info, quizá no busque bien; el punto es que, creo no esta demás replicar una vez más este código: Saludos...