Hi, 

I have configured the Oracle-ds.xml as follows:

  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>OracleDS</jndi-name>
  |     
<connection-url>jdbc:oracle:thin:@192.168.150.122:1521:dna</connection-url>
  |     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
  |     <user-name>admin</user-name>
  |     <password>admin</password>
  |         
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
  | 
  |       <metadata>
  |          <type-mapping>Oracle11g</type-mapping>
  |       </metadata>
  |   </local-tx-datasource>
  | 
  | </datasources>
  | 

I am using my JSP to connect to the Database:
<%
  | String sql = "select * from product";
  | try{
  | 
  | Properties env = new Properties();
  | 
  | env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
  |     "org.jnp.interfaces.NamingContextFactory");
  | env.setProperty(Context.PROVIDER_URL,
  |     "jnp://localhost:1099");
  | env.setProperty(Context.URL_PKG_PREFIXES,
  |     "org.jboss.naming:org.jnp.interfaces");
  |     
  | InitialContext iniCtx = new InitialContext(env);
  | 
  | Object ref = iniCtx.lookup("OracleDS");
  | //I tried using java:OracleDS and  java:/OracleDS
  | 
  | 
  | Connection conn = (Connection) ref;
  | 
  | Statement stmt = conn.createStatement();
  | 
  | ResultSet res = stmt.executeQuery(sql);
  | }catch(Exception e){
  |      out.println("In exception blocl.....");
  |      out.println("The exc is :"+e);
  | }
  | %>
  | </body>
  | </html>
  | 

Can anybody please suggest me the solution.

Thanks in Advance.

Thanks
SriVathsa




View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3934586#3934586

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3934586


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to