{"id":48,"date":"2018-09-02T15:09:00","date_gmt":"2018-09-02T15:09:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/2018\/09\/02\/how-to-connect-netbeans-to-ms-access-database-and-view-data\/"},"modified":"2020-08-22T20:59:16","modified_gmt":"2020-08-22T18:59:16","slug":"how-to-connect-netbeans-to-ms-access-database-and-view-data","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/how-to-connect-netbeans-to-ms-access-database-and-view-data\/","title":{"rendered":"How to Connect Netbeans to MS Access Database and View Data"},"content":{"rendered":"<p>In this lesson, you will learn how to connect Netbeans IDE to Microsoft Access database and used MS Access as your data-source in\u00a0 your Java Project.<\/p>\n<p>This would be in three steps. You can find the three steps below<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step 1: Create a database in Microsoft Access<\/strong><br \/>\nYou already know how to do this. To be able to follow this lesson:<br \/>\nName the database LessonDB<br \/>\nCreate a table and Name it tblStudents<br \/>\nIn the table create four columns<\/p>\n<ul>\n<li>ID<\/li>\n<li>Firstname<\/li>\n<li>Lastname<\/li>\n<li>Department<\/li>\n<\/ul>\n<p>If you have done this correctly, your design view in MS Access would look like shown below:<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/4.bp.blogspot.com\/-iriIcMuqNxg\/WifR8u-18AI\/AAAAAAAAAWw\/1t8TE7hlo4waSZ9slMnLsDz15PxnTfKqwCLcBGAs\/s1600\/Connect-Netbeans-to-MS-Access-Design.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/4.bp.blogspot.com\/-iriIcMuqNxg\/WifR8u-18AI\/AAAAAAAAAWw\/1t8TE7hlo4waSZ9slMnLsDz15PxnTfKqwCLcBGAs\/s320\/Connect-Netbeans-to-MS-Access-Design.JPG\" width=\"320\" height=\"172\" border=\"0\" data-original-height=\"736\" data-original-width=\"1366\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Add some random data into the table in Access. Say about 5 rows or more. We would be able to open and view this data in Netbeans<br \/>\nFor me after adding data to the tables, I have the content of the table as shown below:<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/3.bp.blogspot.com\/-UAickcPQ6A0\/WifSAV6eMzI\/AAAAAAAAAW0\/XRxDv4QC1Ig2MYfvc0SBDXIY0JoOTtcTQCLcBGAs\/s1600\/Connect-Netbeans-to-MS-Access-Datasheet.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/3.bp.blogspot.com\/-UAickcPQ6A0\/WifSAV6eMzI\/AAAAAAAAAW0\/XRxDv4QC1Ig2MYfvc0SBDXIY0JoOTtcTQCLcBGAs\/s320\/Connect-Netbeans-to-MS-Access-Datasheet.JPG\" width=\"320\" height=\"172\" border=\"0\" data-original-height=\"736\" data-original-width=\"1366\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p><strong>Step 2: Create an ODBC datasource<\/strong><\/p>\n<p>Go to Control Panel &gt; Administrative Tools &gt; ODBC Data Sources<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/2.bp.blogspot.com\/-xjiG5kuwkTA\/WifSczK2kBI\/AAAAAAAAAW8\/i3PfOoc0M28bQG0EYcu_HcvZmKhyASGLgCLcBGAs\/s1600\/Connect-Netbeans-to-MS-Access-ODBC-Data-Sources.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/2.bp.blogspot.com\/-xjiG5kuwkTA\/WifSczK2kBI\/AAAAAAAAAW8\/i3PfOoc0M28bQG0EYcu_HcvZmKhyASGLgCLcBGAs\/s320\/Connect-Netbeans-to-MS-Access-ODBC-Data-Sources.JPG\" width=\"320\" height=\"264\" border=\"0\" data-original-height=\"390\" data-original-width=\"471\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Click on System DSN.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/3.bp.blogspot.com\/-uP-hmET69H0\/WifTXT3-kMI\/AAAAAAAAAXM\/VWI4BgG24QQoJNCZ1IbTkxojHuWUBPregCLcBGAs\/s1600\/Connect-Netbeans-to-MS-Access-ODBC-Data-Sources-System-DSN0.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/3.bp.blogspot.com\/-uP-hmET69H0\/WifTXT3-kMI\/AAAAAAAAAXM\/VWI4BgG24QQoJNCZ1IbTkxojHuWUBPregCLcBGAs\/s320\/Connect-Netbeans-to-MS-Access-ODBC-Data-Sources-System-DSN0.JPG\" width=\"320\" height=\"264\" border=\"0\" data-original-height=\"390\" data-original-width=\"471\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Click on Add. It displays the Create New Data Source window<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/4.bp.blogspot.com\/-qEB79fsNLUo\/WifS-lrtk9I\/AAAAAAAAAXI\/cryIPYzwXTkMXjuqBfrqO-0YvfTUG7AZQCLcBGAs\/s1600\/Connect-Netbeans-to-MS-Access-ODBC-Data-Sources-System-DSN.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/4.bp.blogspot.com\/-qEB79fsNLUo\/WifS-lrtk9I\/AAAAAAAAAXI\/cryIPYzwXTkMXjuqBfrqO-0YvfTUG7AZQCLcBGAs\/s320\/Connect-Netbeans-to-MS-Access-ODBC-Data-Sources-System-DSN.JPG\" width=\"320\" height=\"239\" border=\"0\" data-original-height=\"358\" data-original-width=\"478\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Choose Microsoft Access Driver(*.mdb, *.accdb).<\/p>\n<p>Click on Finish. Another window opens up<\/p>\n<p><span style=\"color: red;\">Help!!!! I could not see any drivers listed!!!!<\/span><br \/>\nThe reason for this is that your Operating System is 64 bit while the MS Access is 32 Bit.<\/p>\n<p><span style=\"background-color: white;\"><span style=\"color: lime;\">Solution<\/span><\/span><br \/>\nOpen the Windows Directory in your C drive and notice this two folders<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/2.bp.blogspot.com\/-1_P1iE7TfuA\/WifVCDA4rEI\/AAAAAAAAAXY\/uSDfcLW_dOwXR3tjoetzDj40vvSV7YCDQCLcBGAs\/s1600\/Windows%2BDirectory.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/2.bp.blogspot.com\/-1_P1iE7TfuA\/WifVCDA4rEI\/AAAAAAAAAXY\/uSDfcLW_dOwXR3tjoetzDj40vvSV7YCDQCLcBGAs\/s320\/Windows%2BDirectory.JPG\" width=\"320\" height=\"255\" border=\"0\" data-original-height=\"499\" data-original-width=\"625\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Inside the they SysWOW64, you will find odbcad32. Open it and continue from there. Add a shortcut to it for easy access.<\/p>\n<p><ins style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-7041870931346451\" data-ad-slot=\"4209786523\"><\/ins><br \/>\nNow that you have solved that problem, let&#8217;s continue.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/4.bp.blogspot.com\/-UQtFWmch7N0\/WifWC38OBRI\/AAAAAAAAAXk\/E53cTtWy33AMQSvFcLycbXhzmR9tf1EAwCLcBGAs\/s1600\/Connect-Netbeans-to-MS-Access-Select%2BDatabase.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/4.bp.blogspot.com\/-UQtFWmch7N0\/WifWC38OBRI\/AAAAAAAAAXk\/E53cTtWy33AMQSvFcLycbXhzmR9tf1EAwCLcBGAs\/s320\/Connect-Netbeans-to-MS-Access-Select%2BDatabase.JPG\" width=\"320\" height=\"212\" border=\"0\" data-original-height=\"320\" data-original-width=\"481\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Click on Select, and find the MS Access database we created previously.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/2.bp.blogspot.com\/-qMRvVNuEf-c\/WifW_6YmRvI\/AAAAAAAAAXw\/swOgeXJ8k-oxwXaBWdvq7qpRVxJvQDl9ACLcBGAs\/s1600\/Connect-Netbeans-to-MS-Access-Select%2BDatabase2.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/2.bp.blogspot.com\/-qMRvVNuEf-c\/WifW_6YmRvI\/AAAAAAAAAXw\/swOgeXJ8k-oxwXaBWdvq7qpRVxJvQDl9ACLcBGAs\/s320\/Connect-Netbeans-to-MS-Access-Select%2BDatabase2.JPG\" width=\"320\" height=\"198\" border=\"0\" data-original-height=\"256\" data-original-width=\"412\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Click on OK. This would take you back to the database selection window<\/p>\n<p>Enter a name for the database. For me I used same name LessonDB. (Make sure that MS Access application is closed, otherwise, you can&#8217;t complete it)<\/p>\n<p>Click on Ok to finish.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/2.bp.blogspot.com\/-1oYJQPB1j6w\/WifY1X4CeaI\/AAAAAAAAAX8\/S2UhTibtmGEtCMk-V0Wvq581JGzdSZeogCLcBGAs\/s1600\/Connect-Netbeans-to-MS-Access-LessonDB.JPG\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/2.bp.blogspot.com\/-1oYJQPB1j6w\/WifY1X4CeaI\/AAAAAAAAAX8\/S2UhTibtmGEtCMk-V0Wvq581JGzdSZeogCLcBGAs\/s320\/Connect-Netbeans-to-MS-Access-LessonDB.JPG\" width=\"320\" height=\"212\" border=\"0\" data-original-height=\"320\" data-original-width=\"481\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p><strong>Step 3: Create an Application in Netbeans.<\/strong><\/p>\n<p>You already know how to do that.<\/p>\n<p>Click on the Services tab at the left hand side of the screen.<\/p>\n<p>Expand Databases &gt; Drivers<\/p>\n<p>Right-click on ODBC-JDBC Bridge and click on Connect-Using&#8230; as shown<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/2.bp.blogspot.com\/-7j6oiRGF1vU\/WifkYO_6fGI\/AAAAAAAAAYY\/EvhSUiAYMOo7uTzFexMnMeN8mhofsx0kwCLcBGAs\/s1600\/Connect%2BUsing.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/2.bp.blogspot.com\/-7j6oiRGF1vU\/WifkYO_6fGI\/AAAAAAAAAYY\/EvhSUiAYMOo7uTzFexMnMeN8mhofsx0kwCLcBGAs\/s320\/Connect%2BUsing.jpg\" alt=\"\" width=\"320\" height=\"180\" border=\"0\" data-original-height=\"769\" data-original-width=\"1362\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>It displays the New Connection Wizard dialog box.<\/p>\n<div style=\"font-family: 'segoe ui';\">\n<p>Replace the &lt;DB&gt; with the name of the datasource\u00a0 you created. For me it is LessonDB<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this lesson, you will learn how to connect Netbeans IDE to Microsoft Access database and used MS Access as your data-source in\u00a0 your Java &hellip; <\/p>\n","protected":false},"author":1,"featured_media":555,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[414],"tags":[],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/48"}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":3,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/48\/revisions\/557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media\/555"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}