• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Change data source in IFPWAFCAD netbeans demo project from mysql to microsoft sqlserver

 
Ranch Hand
Posts: 339
7
Tomcat Server Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to do a proof-of-concept project to demo a web application that can do a simple query on one of my Microsoft SQLserver tables. I am using netbeans 7.2.1 and Java sdk 1.6. I found a simple project on the netbeans learning site called IFPWAFCAD that does a query on a mysql database table and returns the results. The URL for the project is http://netbeans.org/kb/docs/web/mysql-webapp.html and I downloaded the application from the link "you can download the sample application" on that page.

The jdbc driver to my sqlserver is setup and running in netbeans. What I am having trouble with is determining how to switch the data source from the mysql to my Microsoft sqlserver. I see a resource-ref tag in the web.xml file and I can see the query code in the index.jsp and response.jsp. But I don't understand where the dataSource that is called in index.jsp with the code below is defined in the project.



Thanks for any help.
 
margaret gillon
Ranch Hand
Posts: 339
7
Tomcat Server Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I read the tutorial again and I originally missed the fact that the project was made with the Glassfish server and the code I quoted is referencing a connection pool

  • Open the New File wizard by pressing the New File ( New File button ) button in the IDE's main toolbar. Select the GlassFish server category, then select JDBC Resource and click Next.
    In step 2, General Attributes, choose the Create New JDBC Connection Pool option, then in the JNDI Name text field, type in jdbc/IFPWAFCAD.


  • How would I make the connection without the Glassfish option? I am using Tomcat 6 and just need a site with examples that I can work through.
     
    And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic