Setup sql server database connection (sqljdbc4) using netbeans on JBoss

Posted: April 22, 2014 in web

1. on netbeans, go to Services tab
2. go to Databases, then Drivers.
3. download sqljdbc jar http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx
4. add driver using (sqljdbc4.jar)
5. you should now connect to sql server by following the steps. Use dbo as schema. (if tables are not showing up select the example ds on the Data Source field and select your ds again, sometimes it needs to refresh)

6. run java web app project.
7. go to http://127.0.0.1:9990/console, provice username/pass if needed.
9. on console upper right click Runtime
10. click Manage Deployments
11. click Add Content and point to the downloaded jar file (sqljdbc4.jar)
12. on upper right clieck on Profile
13. click on Datasources under Connector
14. click Add put in values JNDI should look like this ‘java:jboss/datasources/test2’
15. fill up form fields by looking at the netbeans DB service. Right click on the sqlserver, then click Properties. You should see all the settings there.

16. on console, test connection on Connection tab, if it succeeds then you can use this datasource to build Rest resource wizard style.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s