<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
javax.naming.NameNotFoundException: jdbc not bound
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/smithakutty">Smitha K</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/780560#780560">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I have the following deployment details:-( I am trying to connect to the  database,but getting error)</p><p>1)ejb-jar.xml:-</p><p><?xml version="1.0"?><br/><!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"<br/>"<a class="jive-link-external-small" href="http://java.sun.com/dtd/ejb-jar_2_0.dtd">http://java.sun.com/dtd/ejb-jar_2_0.dtd</a>"><br/><ejb-jar><br/>  <description>A simple session bean</description><br/>  <display-name>Simple Message EJB</display-name><br/>  <enterprise-beans><br/>     <session><br/>      <ejb-name>FirstEJBBean</ejb-name><br/>      <home>FirstEJBHome</home><br/>      <remote>FirstEJBObject</remote><br/>      <local-home>FirstLocalEJBHome</local-home><br/>      <local>FirstLocalEJBObject</local><br/>      <ejb-class>FirstEJBBean</ejb-class><br/>      <session-type>Stateless</session-type><br/>      <transaction-type>Container</transaction-type><br/>      <env-entry><br/>                 <description> Maximum percentage discount for a customer </description><br/>                 <env-entry-name> maxCustomerDiscount </env-entry-name><br/>                 <env-entry-type> java.lang.Double </env-entry-type><br/>                 <env-entry-value> 50 </env-entry-value><br/>      </env-entry><br/>     <ejb-ref><br/>            <ejb-ref-name>ejb/FirstEJBBeanRemoteTest</ejb-ref-name><br/>            <ejb-ref-type>Session</ejb-ref-type><br/>            <home>FirstEJBHome</home><br/>            <remote>FirstEJBObject</remote><br/>           <ejb-link>FirstEJBBean</ejb-link><br/>      </ejb-ref><br/>      <ejb-local-ref><br/>            <ejb-ref-name>ejb/FirstEJBBeanTest</ejb-ref-name><br/>            <ejb-ref-type>Session</ejb-ref-type><br/>            <local-home>FirstLocalEJBHome</local-home><br/>            <local>FirstLocalEJBObject</local><br/>           <ejb-link>FirstEJBBean</ejb-link><br/>      </ejb-local-ref><br/>       <resource-ref><br/>        <res-ref-name>jdbc/nbuDS</res-ref-name><br/>         <res-type>javax.sql.DataSource</res-type><br/>         <res-auth>Container</res-auth><br/>      </resource-ref><br/>    </session><br/></enterprise-beans><br/></ejb-jar></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>2)jboss-xml</p><p class="jive-thread-reply-message"><div class="jive-rendered-content"><div class="mcePaste"></div></div></p><p><?xml version="1.0" encoding="ISO-8859-1"?><br/><jboss><br/>  <enterprise-beans><br/>     <session><br/>      <ejb-name>FirstEJBBean</ejb-name><br/>      <resource-ref><br/>        <res-ref-name>jdbc/nbuDS</res-ref-name><br/>        <jndi-name>jbossDS</jndi-name><br/>       </resource-ref><br/>      <jndi-name>ejb/FirstEJBBeanRemote</jndi-name><br/>   </session><br/>  </enterprise-beans><br/></jboss></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My Local bean code is:-</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>ejbCtx = (Context) context.lookup("java:comp/env");</p><p>dsrc = (DataSource)ejbCtx.lookup("jdbc/nbuDS");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have jboss-ds file in the  default/deply folder configured as  follows:-</p><p><?xml version="1.0" encoding="UTF-8"?><br/><datasources><br/>    <local-tx-datasource><br/>        <jndi-name>jbossDS</jndi-name><br/>        <connection-url>jdbc:sqlserver://172.16.84.66:1433;sendStringParametersAsUnicode=false;databaseName=NBU</connection-url><br/>        <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class><br/>        <min-pool-size>5</min-pool-size><br/>        <max-pool-size>30</max-pool-size><br/>        <track-statements>true</track-statements><br/>  <prepared-statement-cache-size>10</prepared-statement-cache-size><br/>  <query-timeout>60</query-timeout><br/>        <user-name>sa</user-name><br/>        <password>M8$tek12</password><br/></local-tx-datasource><br/></datasources></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>But i am still unable to connect to database.</p><p>Please provide me  inputs for the same.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/780560#780560">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>