WEBVTT 1 00:00:02.342 --> 00:00:05.144 In the last video, we created a simple class 2 00:00:05.144 --> 00:00:07.218 that can store itself into a database 3 00:00:07.218 --> 00:00:09.651 and also initialise itself from the database 4 00:00:09.651 --> 00:00:13.957 if that database exists and the data is in the table. 5 00:00:13.957 --> 00:00:17.499 So, we should now have a few records in our accounts table 6 00:00:17.499 --> 00:00:20.994 and up until now we used the sqlite command line interface 7 00:00:20.994 --> 00:00:22.743 to view our database. 8 00:00:22.743 --> 00:00:24.661 Now it's important to know how to do that 9 00:00:24.661 --> 00:00:26.942 and also how to use the SQL commands, 10 00:00:26.942 --> 00:00:28.377 but now that we're back in IlelliJ, 11 00:00:28.377 --> 00:00:31.067 there's actually an easy way to database view, 12 00:00:31.067 --> 00:00:33.671 so we're gonna be talking about that in this video. 13 00:00:33.671 --> 00:00:35.663 Now I've closed the run window from the last video 14 00:00:35.663 --> 00:00:37.412 because we're gonna need the space 15 00:00:37.412 --> 00:00:39.688 and if you haven't already done it, 16 00:00:39.688 --> 00:00:42.613 split line five like I've done here over two lines, 17 00:00:42.613 --> 00:00:44.446 because that will actually get rid of one of the warnings 18 00:00:44.446 --> 00:00:46.194 over here in the right hand side, 19 00:00:46.194 --> 00:00:48.067 but I've already done that so consequentially, 20 00:00:48.067 --> 00:00:50.231 I haven't actually got that warning. 21 00:00:50.231 --> 00:00:53.453 Now, each line of SQL though, if we have a look at it 22 00:00:53.453 --> 00:00:55.732 and just come over here, has basically got the same 23 00:00:55.732 --> 00:00:57.910 error message, "No data sources are configured 24 00:00:57.910 --> 00:00:59.631 "to run this SQL." 25 00:00:59.631 --> 00:01:01.667 And you can see there's a few there. 26 00:01:01.667 --> 00:01:04.334 And also down here, there's one. 27 00:01:05.489 --> 00:01:08.370 And as I said in the last video, that's not a warning 28 00:01:08.370 --> 00:01:12.195 about our pathing code, it's IntelliJ advising us 29 00:01:12.195 --> 00:01:14.312 that it could check our SQL statements for us 30 00:01:14.312 --> 00:01:16.988 if we configured a data source. 31 00:01:16.988 --> 00:01:18.820 So what we're gonna do is start by opening 32 00:01:18.820 --> 00:01:21.991 the Database Tool window, we can go down or up I should say 33 00:01:21.991 --> 00:01:25.491 to View, Tool Windows and select Database. 34 00:01:30.536 --> 00:01:32.535 I could also have clicked on Database over here 35 00:01:32.535 --> 00:01:34.985 on the right hand side. 36 00:01:34.985 --> 00:01:38.159 Now from here what we can do is create a data source. 37 00:01:38.159 --> 00:01:40.480 We can do that with Control End or Command End, 38 00:01:40.480 --> 00:01:42.106 depending on your operating system, 39 00:01:42.106 --> 00:01:45.321 alternatively we can just click on this little plus, 40 00:01:45.321 --> 00:01:46.581 on the top left here. 41 00:01:46.581 --> 00:01:48.211 But the other way of doing it is just to drag 42 00:01:48.211 --> 00:01:50.732 the database file into the window. 43 00:01:50.732 --> 00:01:52.400 Now this only works if the file has got 44 00:01:52.400 --> 00:01:56.799 the correct extension, now IntelliJ uses the Windows system 45 00:01:56.799 --> 00:01:59.604 where the file extension determines the type of the file. 46 00:01:59.604 --> 00:02:01.801 And that's why it was important to give the database 47 00:02:01.801 --> 00:02:05.857 a .sqlite extension, even on Linus or OSX. 48 00:02:05.857 --> 00:02:08.018 Those two operating systems don't use file extensions 49 00:02:08.018 --> 00:02:10.302 in the same way, but IntelliJ 50 00:02:10.302 --> 00:02:12.617 does rely on them on all platforms. 51 00:02:12.617 --> 00:02:14.932 So what we can do is over here is, we can drag on 52 00:02:14.932 --> 00:02:19.077 this accounts.sqlite and drag it and drop it 53 00:02:19.077 --> 00:02:22.412 into the Database pane and you can see when I did that 54 00:02:22.412 --> 00:02:24.691 we've now got an entry showing. 55 00:02:24.691 --> 00:02:27.363 And I'll just move this over a little bit. 56 00:02:27.363 --> 00:02:29.576 So, now that I've done that, you can see that 57 00:02:29.576 --> 00:02:31.490 some of the errors have disappeared, 58 00:02:31.490 --> 00:02:32.938 but we've still got some other ones here, 59 00:02:32.938 --> 00:02:35.674 one "Unable to resolve column 'balance'", 60 00:02:35.674 --> 00:02:36.852 but the ones that have disappeared 61 00:02:36.852 --> 00:02:40.834 are the ones relating to creation of the tables. 62 00:02:40.834 --> 00:02:43.190 The reason that it's disappeared is that 63 00:02:43.190 --> 00:02:45.919 IntelliJ now knows the names of the tables 64 00:02:45.919 --> 00:02:48.731 and actually recognises the data source. 65 00:02:48.731 --> 00:02:50.646 Now we still got warnings, as I mentioned, 66 00:02:50.646 --> 00:02:52.921 that we can't resolve the column names 67 00:02:52.921 --> 00:02:54.224 and that's because InelliJ doesn't have 68 00:02:54.224 --> 00:02:57.318 the correct driver for sqlite databases. 69 00:02:57.318 --> 00:02:58.823 So the first time you do this, you'll need 70 00:02:58.823 --> 00:03:02.604 to instal the drivers for whichever database you're using. 71 00:03:02.604 --> 00:03:05.007 And that's why accounts in the Database window 72 00:03:05.007 --> 00:03:07.099 is underlined as you can see here. 73 00:03:07.099 --> 00:03:10.923 And if I hover over it, you can see we've got a message 74 00:03:10.923 --> 00:03:14.298 "Can't find the driver, open preferences to download". 75 00:03:14.298 --> 00:03:16.171 So we're gonna right click on this database now 76 00:03:16.171 --> 00:03:18.004 and select Properties. 77 00:03:20.320 --> 00:03:21.500 And there is a link down here where it says 78 00:03:21.500 --> 00:03:26.270 Download missing driver files, so click on that. 79 00:03:26.270 --> 00:03:27.751 And hopefully you can see that it's downloaded 80 00:03:27.751 --> 00:03:30.033 the relevant files for us automatically 81 00:03:30.033 --> 00:03:31.866 and I can click on OK. 82 00:03:33.734 --> 00:03:35.278 And you can see the errors have now disappeared, 83 00:03:35.278 --> 00:03:37.273 the warnings rather have disappeared, 84 00:03:37.273 --> 00:03:39.550 the underline on accounts has disappeared 85 00:03:39.550 --> 00:03:43.743 and IntelliJ is now fully aware of the data source 86 00:03:43.743 --> 00:03:47.562 and as well as the tables and columns within that. 87 00:03:47.562 --> 00:03:50.865 All right, so I just wanna show you a quick slide here, 88 00:03:50.865 --> 00:03:52.977 if you're using Windows, because this step 89 00:03:52.977 --> 00:03:57.144 you might actually get a Windows Security Alert popup. 90 00:03:58.021 --> 00:03:59.892 So this is the dialogue that I'm talking about 91 00:03:59.892 --> 00:04:02.096 and again, this is only a Windows thing, 92 00:04:02.096 --> 00:04:05.995 so you may actually get this popup on your computer. 93 00:04:05.995 --> 00:04:09.366 So if you do get that, it's important 94 00:04:09.366 --> 00:04:12.337 to allow access on private networks. 95 00:04:12.337 --> 00:04:14.132 So righter strangely, the dialogue appears 96 00:04:14.132 --> 00:04:16.281 with Public networks already ticked 97 00:04:16.281 --> 00:04:18.072 and you probably don't want to allow that. 98 00:04:18.072 --> 00:04:20.232 So Untick Pulic networks and make sure 99 00:04:20.232 --> 00:04:22.673 you tick Private networks before clicking 100 00:04:22.673 --> 00:04:24.691 the Allow access button, so I'm just gonna bring 101 00:04:24.691 --> 00:04:26.153 that on the screen again while I'm talking 102 00:04:26.153 --> 00:04:29.447 just so you can see that image, if you don't allow access 103 00:04:29.447 --> 00:04:31.811 on Private networks, you'll get all sorts of problems 104 00:04:31.811 --> 00:04:35.826 with updates and so forth, so again, what we need to do here 105 00:04:35.826 --> 00:04:40.010 if Public networks is ticked and you do get this dialogue, 106 00:04:40.010 --> 00:04:41.435 you probably don't want to allow that, 107 00:04:41.435 --> 00:04:43.832 so you untick Public networks and make sure 108 00:04:43.832 --> 00:04:45.863 you tick Private networks before clicking 109 00:04:45.863 --> 00:04:47.938 on the Allow access button. 110 00:04:47.938 --> 00:04:49.400 All right, so back to the slide. 111 00:04:49.400 --> 00:04:51.840 So notice that this dialogue may appear again, 112 00:04:51.840 --> 00:04:55.011 after a Java update, so it is a persistent setting, 113 00:04:55.011 --> 00:04:57.775 but a new of Java will trigger it again. 114 00:04:57.775 --> 00:05:00.464 And again, this is only a Windows thing. 115 00:05:00.464 --> 00:05:02.700 Okay, so now that we've got the right drivers, 116 00:05:02.700 --> 00:05:05.760 the warnings disappear and IntelliJ can verify 117 00:05:05.760 --> 00:05:07.351 our table and column names as you can see. 118 00:05:07.351 --> 00:05:10.238 So that's pretty cool, but it does actually get better. 119 00:05:10.238 --> 00:05:14.873 And I'm just gonna expand this out a little bit again. 120 00:05:14.873 --> 00:05:17.206 And if we now expand this, we can see that 121 00:05:17.206 --> 00:05:19.935 it's showing us helpfully the list of tables 122 00:05:19.935 --> 00:05:21.806 and we can expand those further and actually see 123 00:05:21.806 --> 00:05:24.813 the columns within tables and note that 124 00:05:24.813 --> 00:05:28.842 for the transactions table, time is showing as TEXT 125 00:05:28.842 --> 00:05:31.158 rather than TIMESTAMP and you'll only see 126 00:05:31.158 --> 00:05:34.886 the normal sqlite types when you the schema this way, 127 00:05:34.886 --> 00:05:37.689 so it's not actually perfect, you do have to take care 128 00:05:37.689 --> 00:05:40.222 if you modify any nonstandard columns from here, 129 00:05:40.222 --> 00:05:41.605 but it's still a very useful feature 130 00:05:41.605 --> 00:05:43.844 and makes life a lot easier. 131 00:05:43.844 --> 00:05:46.692 Now you can also double click on the table names 132 00:05:46.692 --> 00:05:50.107 or use the Table Editor button on the toolbar, 133 00:05:50.107 --> 00:05:51.453 which is this button here, which is greyed out, 134 00:05:51.453 --> 00:05:54.745 because I haven't selected a table. 135 00:05:54.745 --> 00:05:57.269 Clicking on that actually gives us a list 136 00:05:57.269 --> 00:06:00.033 of entries that are actually in the database. 137 00:06:00.033 --> 00:06:02.031 Or specifically in that table. 138 00:06:02.031 --> 00:06:03.941 And up here, you've actually got an entry 139 00:06:03.941 --> 00:06:05.439 where you can actually add a new row 140 00:06:05.439 --> 00:06:07.883 and because we've got accounts open, 141 00:06:07.883 --> 00:06:10.808 this toolbar is relating to the accounts table, 142 00:06:10.808 --> 00:06:12.392 we can actually add a new record if we want, 143 00:06:12.392 --> 00:06:16.133 so I click on that and double click into the record, 144 00:06:16.133 --> 00:06:18.573 or into the column rather, enter a new name 145 00:06:18.573 --> 00:06:22.069 say Michael, I can tab or double click on the balance 146 00:06:22.069 --> 00:06:25.645 and let's put in 500, press enter there. 147 00:06:25.645 --> 00:06:28.170 So we add another record, we need another Terry, 148 00:06:28.170 --> 00:06:31.257 so let's double click type Terry in here, 149 00:06:31.257 --> 00:06:34.257 and and we put in an amount of zero. 150 00:06:35.288 --> 00:06:36.920 Now we get an error or rather, 151 00:06:36.920 --> 00:06:39.684 we should get an error but we don't yet. 152 00:06:39.684 --> 00:06:41.716 Now note that the two new entries 153 00:06:41.716 --> 00:06:44.728 are highlighted in green here, we've added the rows 154 00:06:44.728 --> 00:06:46.845 but the change hasn't been commuted to the database, 155 00:06:46.845 --> 00:06:48.429 that's why it's in green. 156 00:06:48.429 --> 00:06:51.158 So two buttons have become available up here on the toolbar 157 00:06:51.158 --> 00:06:53.439 and they're quite small though so might have to 158 00:06:53.439 --> 00:06:55.759 sort of squinch your eyes to see them. 159 00:06:55.759 --> 00:06:57.993 So I've got this one here, which is gonna be Submit 160 00:06:57.993 --> 00:07:01.444 and we've got this one here which is Revert. 161 00:07:01.444 --> 00:07:04.287 And notice that it wasn't active, the Revert button 162 00:07:04.287 --> 00:07:07.941 until I selected a record, so if I've got Terry selected 163 00:07:07.941 --> 00:07:12.863 clicking on Revert once removes and if I click on it again 164 00:07:12.863 --> 00:07:16.135 that's removed Michael as well and it's now disabled 165 00:07:16.135 --> 00:07:18.665 because of course everything's been commuted to the database 166 00:07:18.665 --> 00:07:21.068 and there's nothing to update or revert. 167 00:07:21.068 --> 00:07:25.235 All right, so we're gonna add those two entries again. 168 00:07:28.178 --> 00:07:31.011 Michael, 500 and also Terry, zero. 169 00:07:36.681 --> 00:07:39.773 This time I'm gonna submit the change 170 00:07:39.773 --> 00:07:41.936 line:15% and notice we've got an error down the bottom. 171 00:07:41.936 --> 00:07:43.763 line:15% Abort due to constraint violation 172 00:07:43.763 --> 00:07:46.897 line:15% (UNIQUE constraint failed: accounts.name) 173 00:07:46.897 --> 00:07:49.127 line:15% So why are we actually getting this error? 174 00:07:49.127 --> 00:07:51.896 line:15% Well, it's because the name column is the primary key 175 00:07:51.896 --> 00:07:54.924 line:15% and primary key fields have to be unique. 176 00:07:54.924 --> 00:07:56.635 line:15% And right down the bottom of the screen you can see 177 00:07:56.635 --> 00:07:58.916 line:15% that it's even showing you the SQL that 178 00:07:58.916 --> 00:08:02.582 line:15% it was trying to use to add these records to the database, 179 00:08:02.582 --> 00:08:05.012 line:15% So in this case it's failed, again, because of 180 00:08:05.012 --> 00:08:09.179 the unique constraint as duplicating the name Terry. 181 00:08:10.912 --> 00:08:12.699 So let's go ahead and make this new Terry unique, 182 00:08:12.699 --> 00:08:17.257 so I'll put Terry and we'll put TerryG there this time. 183 00:08:17.257 --> 00:08:20.021 And if I submit this time, you'll see 184 00:08:20.021 --> 00:08:23.934 that it worked successfully and the entries are no longer 185 00:08:23.934 --> 00:08:25.562 in green which tells us that they've been actually 186 00:08:25.562 --> 00:08:27.395 added to the database. 187 00:08:28.968 --> 00:08:31.977 At this point I can't then Revert the change 188 00:08:31.977 --> 00:08:33.240 and just to show you something here, if I change 189 00:08:33.240 --> 00:08:36.407 this TerryG to TerryH, whoops, TerryH, 190 00:08:42.400 --> 00:08:45.163 we can then revert that change if we want to. 191 00:08:45.163 --> 00:08:47.278 Now on some operating systems you may get 192 00:08:47.278 --> 00:08:49.961 something weird happen here, sometimes you might find 193 00:08:49.961 --> 00:08:53.663 that the Revert button doesn't get enabled 194 00:08:53.663 --> 00:08:55.209 and what you may have to do is click on 195 00:08:55.209 --> 00:08:57.971 this little circular arrow thing here 196 00:08:57.971 --> 00:09:00.221 to actually refresh the table and then you'll find 197 00:09:00.221 --> 00:09:01.956 that you'll be able to use the revert button. 198 00:09:01.956 --> 00:09:04.355 But as you see it didn't occur on my Mac, 199 00:09:04.355 --> 00:09:07.574 but it may occur on Windows or Linux sometimes, 200 00:09:07.574 --> 00:09:11.933 I believe it's possibly a bug with IntelliJ. 201 00:09:11.933 --> 00:09:15.837 Right so, at this point now, we've actually got an account 202 00:09:15.837 --> 00:09:18.884 for each member of my department and that's really 203 00:09:18.884 --> 00:09:21.810 the IntelliJ Database Viewer in a nutshell. 204 00:09:21.810 --> 00:09:25.504 Now you can actually use this Database Viewer 205 00:09:25.504 --> 00:09:27.907 to view a range of different databases 206 00:09:27.907 --> 00:09:29.419 and obviously you can't drag things like 207 00:09:29.419 --> 00:09:31.695 Microsoft SQL Server databases into the window 208 00:09:31.695 --> 00:09:34.053 to configure it, so if that's the case 209 00:09:34.053 --> 00:09:35.681 and you want to do that, you come up here 210 00:09:35.681 --> 00:09:39.019 and you click on plus, the top left of the Database window 211 00:09:39.019 --> 00:09:40.930 and you choose the Data Source that you want, 212 00:09:40.930 --> 00:09:43.330 Data Source, you can see there's quite a few there, 213 00:09:43.330 --> 00:09:45.142 and you select the appropriate database type 214 00:09:45.142 --> 00:09:46.995 from the listing, configure your connexion. 215 00:09:46.995 --> 00:09:51.420 So for example you if I choose SQL Server (Microsoft) 216 00:09:51.420 --> 00:09:53.779 we have the usual configuration options for 217 00:09:53.779 --> 00:09:56.302 connecting to a SQL server database. 218 00:09:56.302 --> 00:09:58.342 Now if you've never used SQL server, don't worry about it, 219 00:09:58.342 --> 00:10:00.412 I'm just showing you what's possible, 220 00:10:00.412 --> 00:10:03.624 if you do need to connect to a SQL Server or Oracle 221 00:10:03.624 --> 00:10:06.345 or DB2 or whatever, the database admins will 222 00:10:06.345 --> 00:10:09.066 give you the details to enter into this form anyway. 223 00:10:09.066 --> 00:10:12.401 All right, so I'm gonna Cancel this. 224 00:10:12.401 --> 00:10:14.026 All right, so there's one more thing that I wanna cover 225 00:10:14.026 --> 00:10:17.118 before we move on, now we're going to be looking at 226 00:10:17.118 --> 00:10:20.207 committing and rolling back database transactions. 227 00:10:20.207 --> 00:10:23.261 But we've also got a table called transactions 228 00:10:23.261 --> 00:10:26.764 that stores data of financial transactions. 229 00:10:26.764 --> 00:10:28.798 Now using the same word for both of these things 230 00:10:28.798 --> 00:10:31.960 is going to get confusing very quickly. 231 00:10:31.960 --> 00:10:33.465 So what we're going to do is rename 232 00:10:33.465 --> 00:10:36.310 our transactions table to history. 233 00:10:36.310 --> 00:10:38.259 Now renaming tables and columns is something 234 00:10:38.259 --> 00:10:40.215 you may need to do, which is why 235 00:10:40.215 --> 00:10:44.214 I've contrived to this excuse to show you how to do it. 236 00:10:44.214 --> 00:10:45.639 So firstly, I want to close down 237 00:10:45.639 --> 00:10:49.216 this Database Viewer window for accounts 238 00:10:49.216 --> 00:10:52.104 to go back to our code and I'm gonna close down 239 00:10:52.104 --> 00:10:53.854 the database for now. 240 00:10:57.919 --> 00:10:59.875 So the first thing we need to do is to make a change 241 00:10:59.875 --> 00:11:02.520 to the code so that we don't go creating 242 00:11:02.520 --> 00:11:05.979 a new row for Terry, so we come down here, 243 00:11:05.979 --> 00:11:08.061 on line 53, and we're gonna make 244 00:11:08.061 --> 00:11:11.473 that Account equals TerryG, instead of Terry, 245 00:11:11.473 --> 00:11:14.610 so we avoid any problems with violating 246 00:11:14.610 --> 00:11:17.295 the unique constraint and the other thing I wanna do 247 00:11:17.295 --> 00:11:19.895 is now retrieve those two entries, 248 00:11:19.895 --> 00:11:23.714 actually we'll change that to TerryJ, 249 00:11:23.714 --> 00:11:25.705 so we wanna retrieve the two entries that we've created 250 00:11:25.705 --> 00:11:29.872 in the Database Viewer, so michael = Account("Michael") 251 00:11:35.226 --> 00:11:39.248 and then also terryG, which again we added 252 00:11:39.248 --> 00:11:43.415 in the Database Viewer, = Account("TerryG"), all right. 253 00:11:46.486 --> 00:11:48.069 So if you run this. 254 00:11:50.263 --> 00:11:53.525 line:15% You can see we've got, I'll just scroll this up a little bit 255 00:11:53.525 --> 00:11:55.070 line:15% just to expand this a little bit higher 256 00:11:55.070 --> 00:11:58.327 line:15% so we can see everything, we can see that all six objects 257 00:11:58.327 --> 00:12:01.099 line:15% are being populated from the database. 258 00:12:01.099 --> 00:12:02.732 line:15% So the first one for John and then we've got one 259 00:12:02.732 --> 00:12:05.941 line:15% for Graham, Eric, Michael and TerryG. 260 00:12:05.941 --> 00:12:08.951 line:15% And if I just run that again, we can now that I've done that 261 00:12:08.951 --> 00:12:12.686 line:15% I've got six retrievals here, we've got John, TerryJ, 262 00:12:12.686 --> 00:12:16.345 line:15% Graham, Eric, Michael and TerryG, so all six now 263 00:12:16.345 --> 00:12:18.577 line:15% are being populated from the database. 264 00:12:18.577 --> 00:12:21.341 line:15% And if you recall with the Michael record, 265 00:12:21.341 --> 00:12:23.376 line:15% we didn't specify an account balance, 266 00:12:23.376 --> 00:12:27.240 line:15% but you can see here that the balance is showing as five, 267 00:12:27.240 --> 00:12:29.962 line:15% so that was retrieved from the accounts table. 268 00:12:29.962 --> 00:12:32.771 All right, so to modify the transactions table, 269 00:12:32.771 --> 00:12:35.168 how do we actually go about making that change? 270 00:12:35.168 --> 00:12:36.507 Well, we open the Database window again, 271 00:12:36.507 --> 00:12:38.948 I can also click over here to open that. 272 00:12:38.948 --> 00:12:42.561 And if we come over here now to the transactions table, 273 00:12:42.561 --> 00:12:46.709 I can right click and choose Modify Table, 274 00:12:46.709 --> 00:12:49.388 and in the Modify Table dialogue, we can just 275 00:12:49.388 --> 00:12:51.141 type the new name for the table, 276 00:12:51.141 --> 00:12:53.220 replace the existing name transactions, 277 00:12:53.220 --> 00:12:57.245 which I mentioned we're gonna do and change that to history. 278 00:12:57.245 --> 00:13:00.013 line:15% And notice on the bottom that IntelliJ is helpfully 279 00:13:00.013 --> 00:13:02.831 line:15% showing the SQL command that it's gonna execute 280 00:13:02.831 --> 00:13:05.967 line:15% to perform the action, so that's honestly pretty cool. 281 00:13:05.967 --> 00:13:07.514 line:15% You know, but have in mind though, this doesn't 282 00:13:07.514 --> 00:13:09.592 line:15% mean that we can now forget all the SQL movement 283 00:13:09.592 --> 00:13:11.750 line:15% so far in the course though. 284 00:13:11.750 --> 00:13:13.704 line:15% So I'm gonna Execute the SQL statement, 285 00:13:13.704 --> 00:13:16.532 line:15% IntelliJ checks at our code, will check to see our code 286 00:13:16.532 --> 00:13:19.868 line:15% to see if anything in there will also need to change, 287 00:13:19.868 --> 00:13:24.093 line:15% so I click on Execute, you can see that it's telling us here 288 00:13:24.093 --> 00:13:27.181 line:15% that we need to make a change, because it's still referring 289 00:13:27.181 --> 00:13:30.433 line:15% to the transactions table, so keep in mind that IntelliJ 290 00:13:30.433 --> 00:13:33.733 line:15% doesn't yet take care of changing the code for us 291 00:13:33.733 --> 00:13:36.787 line:15% until we actually go ahead and click on Do Refactor. 292 00:13:36.787 --> 00:13:39.633 line:15% So click on Do Refactor and you can see over here 293 00:13:39.633 --> 00:13:41.798 obviously history is now the name, 294 00:13:41.798 --> 00:13:43.671 so I'm gonna close that off, database. 295 00:13:43.671 --> 00:13:45.500 But the other thing that we need to change though 296 00:13:45.500 --> 00:13:48.144 is here on line five, noting that it hasn't changed 297 00:13:48.144 --> 00:13:50.585 the transactions table there, so we need to change that 298 00:13:50.585 --> 00:13:55.352 to history and lastly I'm gonna show you is this is also 299 00:13:55.352 --> 00:13:57.834 an option here, when we go to our table 300 00:13:57.834 --> 00:14:00.682 in the Database Viewer, we right click that, 301 00:14:00.682 --> 00:14:03.814 we can click on Rename, but doesn't do the same check 302 00:14:03.814 --> 00:14:07.226 in the source code, so for that reason I think it's better 303 00:14:07.226 --> 00:14:08.771 for you to use the Modify Table 304 00:14:08.771 --> 00:14:11.166 and that's we used that in this video. 305 00:14:11.166 --> 00:14:13.647 All right, and we'll just run this again 306 00:14:13.647 --> 00:14:16.011 to make sure it still works. 307 00:14:16.011 --> 00:14:17.433 line:15% And we still got the same results, 308 00:14:17.433 --> 00:14:19.221 line:15% we're now using the new table. 309 00:14:19.221 --> 00:14:21.659 All right, so let's now remove the confusion 310 00:14:21.659 --> 00:14:23.447 around the word transaction, so I'm gonna 311 00:14:23.447 --> 00:14:25.847 stop the video here and in the next video, 312 00:14:25.847 --> 00:14:27.964 we're gonna continue on with our accounts programme 313 00:14:27.964 --> 00:14:29.514 and rolling back transactions. 314 00:14:29.514 --> 00:14:31.681 See you in the next video.