title: connecting to derby database with tomcat as the server
body: <p>How do i connect to derby database <em>(that comes with the netbeans)</em> ? I am using Tomcat as the server. Earlier i used the following statements to connect to the derby database,but then i used <code>glassfish</code> as the server.</p>
  
  <pre><code>Context context = new InitialContext();
  DataSource ds = (DataSource)context.lookup("java:comp/env/jdbc/PollDatasource");
  Connection connection = ds.getConnection();
  </code></pre>
  
  <p>But now using Tomcat as the server i am unaware how to do this. </p>
  
  <p><em>Note : Tomcat and Derby are pre installed with netbeans IDE that i am using currently</em> </p>