"); out.println(""); out.println(""); out.println(""); } }
Lisa Tolliver11/21/20028:09:47 PMNever mind, I guess we can use the web board.
Haomin Wang11/21/20028:10:20 PMAs far as I can tell from assignments turned in, Bruce Long, and Cliff de Long
Haomin Wang11/21/20028:10:40 PMand you and Marsha
Haomin Wang11/21/20028:11:44 PMI've just posted some additional notes on Week 12 assignments for Track II
Marsha Utech11/21/20028:12:08 PMI have rechecked my driver and it is there in odbc but when I run it in tomcat, its not finding it. I'm still trying because I would really like to know more about databases.
Haomin Wang11/21/20028:12:14 PMfor this assignment, you'll need to use arrays in Java
Haomin Wang11/21/20028:12:56 PMMarsha: you mean you couldn't find the database when you tried to set up the DSN?
Marsha Utech11/21/20028:13:36 PMNo, I found everything and it looks like it is set in stone, untill I run it on tomcat
Haomin Wang11/21/20028:13:53 PMwhat error message did you get?
Marsha Utech11/21/20028:14:16 PMinternal error()
Marsha Utech11/21/20028:14:26 PMI read that it could not find the name driver
Marsha Utech11/21/20028:14:49 PMMicrosoft][ODBC Driver Manager] Data source name not found and no default driver specified
Lisa Tolliver11/21/20028:15:22 PMHaomin, I had a hard time with the arrays in the first half of this class. Is there some way you can explain them in a simplified version?
Haomin Wang11/21/20028:15:22 PMYour DSN was not set up properly then
Haomin Wang11/21/20028:16:01 PMLisa: an array is a group of items organized as a cluster
Marsha Utech11/21/20028:16:03 PMI typed USstates in the DSN and selected My Documents as a directory
Haomin Wang11/21/20028:17:16 PMMarsha: the point is not to type "UStates" (because you can type in a different name. The point is to have the correct driver on the computer and set up the correct connection
Haomin Wang11/21/20028:17:59 PMThe reason for using an array is mainly to store and access data using an index value
Haomin Wang11/21/20028:18:44 PMMarsha: Where did you run your Tomcat? On a laptop or desktop?
Haomin Wang11/21/20028:19:20 PMFor example, when we store 50 states in an array, we can access any one of them using a specific index value
Haomin Wang11/21/20028:20:00 PMthis principle is important in database work
Marsha Utech11/21/20028:20:48 PMI can't believe, it I don't know what I did, but it is now working, wow that took awhile thanks for being patient Haomin
Haomin Wang11/21/20028:21:22 PMMarsha: are you seeing data displayed?
Marsha Utech11/21/20028:21:31 PMYes I am!
Marsha Utech11/21/20028:21:46 PMConnection is: sun.jdbc.odbc.JdbcOdbcConnection@1719f30 Statement is: sun.jdbc.odbc.JdbcOdbcStatement@bfbbe3
Haomin Wang11/21/20028:21:49 PMthen you made it!
Roxanne Everhard11/21/20028:22:16 PMHello everyone
Haomin Wang11/21/20028:22:35 PMThese two values are dynamic. they can change each time you connect to the database Connection is: sun.jdbc.odbc.JdbcOdbcConnection@1719f30 Statement is: sun.jdbc.odbc.JdbcOdbcStatement@bfbbe3
Haomin Wang11/21/20028:22:53 PMHi, Roxanne
Haomin Wang11/21/20028:23:17 PMRoxanne: did you have a chance to review the sample script I sent you?
Marsha Utech11/21/20028:23:28 PMokay thanks, to change colors or anything of that sort, it is always within the script , correct
Haomin Wang11/21/20028:24:00 PMdepending on which part of the page
Haomin Wang11/21/20028:24:14 PMif it's the page background, it's in the body tag
Haomin Wang11/21/20028:24:32 PMif it's table background, it's in the table tag
Haomin Wang11/21/20028:24:58 PMif it's a table row, it's in
Roxanne Everhard11/21/20028:25:31 PMYes, and I resent another to you last night.
Haomin Wang11/21/20028:25:43 PMor color can be applied to a table cell
Marsha Utech11/21/20028:26:08 PMwhat about text color?
Roxanne Everhard11/21/20028:26:23 PMAlthough I gave up on have the checkboxes with all the answers being correct... didn't figure out how to do that
Haomin Wang11/21/20028:26:35 PMI haven't been able to read your last email then, Roxanne. I'll get back to you tomorrow morning
Roxanne Everhard11/21/20028:26:44 PMok
Haomin Wang11/21/20028:27:24 PMI can't believe there could be this many emails piled up in my mail box within 5 days
Marsha Utech11/21/20028:27:41 PMignore my e-mail I sent tonight
Haomin Wang11/21/20028:28:13 PMtext color is text here
Haomin Wang11/21/20028:28:49 PMdon't forget the closing tag
Marsha Utech11/21/20028:28:59 PMok thanks
Haomin Wang11/21/20028:29:10 PMotherwise, the font setting can extend all the way down
Cliff De Long11/21/20028:29:11 PM17519 total for 18 months in my inbox (unsorted)
Paulette Mangold11/21/20028:30:02 PMyou were saying about the arrays?
Haomin Wang11/21/20028:30:03 PMSome more efficient ways have to be found for processing emails
Haomin Wang11/21/20028:30:35 PMHi, Paulette. Yes, we discussed arrays briefly
Paulette Mangold11/21/20028:30:51 PMhello
Haomin Wang11/21/20028:31:11 PMWeelk 5 has the most discussion on arrays
Roxanne Everhard11/21/20028:31:17 PM[Private] Ughh...unsorted? That would drive me insane. The other day I showed some people at school how to use folders to organize their email and they were sooooo impressed. It's good to feel smart sometimes!
Paulette Mangold11/21/20028:31:33 PMI didn't really understand that either
Haomin Wang11/21/20028:31:43 PMwith database, arrays will be more frequently used
Kim Larson11/21/20028:33:04 PMI have a question about Track 1 - week 12
Haomin Wang11/21/20028:33:16 PMgo ahead, Kim
Lisa Tolliver11/21/20028:33:50 PMNo wonder you don't reply, Cliff!
Kim Larson11/21/20028:33:54 PMI have the menus working, but can't figure out how to change the number of items in the menu
Kim Larson11/21/20028:34:31 PMDoes it have to do with the length?
Lisa Tolliver11/21/20028:34:54 PMHaomin, I've read Ch. 22 in the book, and also gone back to our previous chapters about arrays, and can't seem to find anything on sorting within an array
Haomin Wang11/21/20028:35:00 PMFirst of all, you add the URL in the menu item list Auto Bytel
Auto Vantage
cars direct
Kelly Blue Book
Kim Larson11/21/20028:35:30 PMOK
Lisa Tolliver11/21/20028:35:37 PMAlso, as I said, I can get the states in order both MAX and MIN, but cannot figure out how to get the largest and smallest 3 instead of just 1
Haomin Wang11/21/20028:35:50 PMLisa: we can do the 6 states without sorting. I'll get back to that later
Lisa Tolliver11/21/20028:35:56 PMok
Haomin Wang11/21/20028:36:07 PMTo add a menu item Auto Bytel
Auto Vantage
cars direct
Kelly Blue Book
Haomin Wang11/21/20028:37:24 PM Auto Bytel
Auto Vantage
cars direct
new link
Kim Larson11/21/20028:38:13 PMThat would still only give you 4, but what if I want 3 or 5 items in the list?
Roxanne Everhard11/21/20028:38:13 PMI'm starting on week 10...is anyone familiar with searching within BigChalk.com...do they use frames?
Haomin Wang11/21/20028:38:39 PMHere's a better one: Auto Bytel
Auto Vantage
cars direct
Kelly Blue Book
New Link
Haomin Wang11/21/20028:39:03 PMor Auto Bytel
Kelly Blue Book
New Link
Kim Larson11/21/20028:39:57 PMSo is that the only place you need to change? Only change the lines with the links?
Haomin Wang11/21/20028:39:59 PMthen you need to adjust the top attribute values in: Lessons > Week 12 > (JavaScript) > Page 1 > Page 2 > Page 3 Pull-Down Menus We don't have to use existing image files to create graphics in a Web page. Dynamic HTML and JavaScript allow us to use the object properties of modern browsers to create graphs and image. In Chapter 13 of Negrino & Smith's book, we have examples of pull-down menus and and sliding menus. These menus can be useful when we have more content than the space in a Web page can allow. To create interactive menus, we need to use Cascading Style Sheet (CSS). Here's an adapted version of the pull-down menu example from Chapter 13 of Negrino & Smith's book. You may also need to refer back to the lesson notes of Week 9 for some basics of CSS, particularly the concept of class in CSS. There are a few points we need to explain here: 1. First of all, we need to create two classes for two different menus: menu1 and menu2. In this example, the two menu classes differ only in one attribute: the distance from the browser window top border, because the two menus have different number of items and therefore different heights. Note that the two class names are used in the HTML body section to refer back to the classes. 2. The second type of selector we use is the ID tag. Like a class, an ID tag encloses a block of format definitions. Compared with ID, a class is more generic in scope, whereas an ID is more specific. We can use both a class and an ID to apply formatting definitions to parts of text in a top-down cascading manner. In our example, two IDs are created: #searchMenu1 and #searchMenu2. The two IDs take arguments specifying the distance each menu should have from the left border of the browser window, and their widths. You may review pp. 250-251 of Negrino & Smith's book on ID in CSS. 3. In the HTML body, we use the
tag to create block level CSS. Each DIV has an ID which equals the ID created earlier in the style definitions. Each DIV also has
Haomin Wang11/21/20028:41:06 PMI'm sorry; copied too much. Here's what it was supposed to be: .menu1 {      position:absolute;                      font:12px arial, helvetica, sans-serif;                      background-color:#cccc99;                      layer-background-color:#CCCC99;                      top:-120px;                      padding: .2em              } .menu2 {       position:absolute;                      font:12px arial, helvetica, sans-serif;                      background-color:#cccc99;                      layer-background-color:#CCCC99;                      top:-90px;                      padding: .2em              }
Kim Larson11/21/20028:42:12 PMSo the top: -90px line is the one you would change - smaller number for shorter list and larger number for longer list?
Haomin Wang11/21/20028:42:48 PMYou may also need to change the value in the toggleMenu() function onMouseout="toggleMenu('searchMenu1',-112)
Haomin Wang11/21/20028:43:20 PMThe value -112 specifies the vertical position of the menu when the mouse moves out of the menu
Haomin Wang11/21/20028:44:37 PM0 is the border position. Minus values are above the border (out of the window and become invisible). Positive is below the boder (visible)
Kim Larson11/21/20028:46:12 PMOK, thanks - I will work with that and let someone else ask questions.
Haomin Wang11/21/20028:48:24 PMI modified the sample pull-menus a litte. You may want to take a look at http://courses.dsu.edu/cet756/lessons/Week12/pulldown_menus.htm
Kim Larson11/21/20028:48:59 PMThanks
Haomin Wang11/21/20028:50:32 PMLisa and Paulette: do you want to further disucss arrays?
Lisa Tolliver11/21/20028:51:18 PMyes, please
Paulette Mangold11/21/20028:51:20 PMI would
Lisa Tolliver11/21/20028:51:58 PMJust mainly how to find the 3 instead of 1
Haomin Wang11/21/20028:52:29 PMLet's have an analogy. Say, you have a pile of sticks that you want to put into order, what could you do?
Paulette Mangold11/21/20028:53:01 PMsort by size
Haomin Wang11/21/20028:53:06 PMYou can align them into a row, and then shift their positions
Haomin Wang11/21/20028:53:12 PMright!
Haomin Wang11/21/20028:53:41 PMwhen you put them into a row, you can visualize them as an array
Haomin Wang11/21/20028:54:04 PMa grooup of objects that are of the same type, but different values
Lisa Tolliver11/21/20028:54:23 PMgot it
Paulette Mangold11/21/20028:54:39 PMme too
Haomin Wang11/21/20028:54:42 PMand you need to put them in order so that you can access any one of them in a specific way
Lisa Tolliver11/21/20028:55:02 PMokay
Haomin Wang11/21/20028:55:19 PMit's like lining up a grooup students in accordance with their heights
Paulette Mangold11/21/20028:55:46 PMbut the trick is to ask the right questions to get the right ones to step forward
Cliff De Long11/21/20028:55:50 PMIf we create an MSaccess db on a workstation and then upload it to a TomCat directory, can it be modified w/ a JSP script if neither MSaccess or MSsql is installed? If so, what would the rudimentary steps to this task be?
Haomin Wang11/21/20028:56:29 PMthen you can order out either the tallest or the shortest or the one in the middle
Haomin Wang11/21/20028:57:13 PMThe array index is the key
Haomin Wang11/21/20028:57:55 PMAn array must have a size so that you know which is the last element
Haomin Wang11/21/20028:58:21 PMIf you use an index value that's out of an array's size, error message pop up
Haomin Wang11/21/20028:59:25 PMCliff: a database can be placed anywhere on your computer, though it's usually suggested that you don't place in an open web directory
Haomin Wang11/21/20029:00:04 PMSo, whether it's MS Access or MySQL, you can place it directly under C or "My Documents" or on your Desktop
Haomin Wang11/21/20029:00:54 PMThe important part is to find the database and set up the right path when you set up the DSN
Marsha Utech11/21/20029:00:55 PMI'm curious, after week 14 how long do we have to turn in our assignments?
Lisa Tolliver11/21/20029:01:32 PMso should the array stop after 2 (0, 1 and 2)?
Haomin Wang11/21/20029:01:59 PMdepending how many assignments are undue before I send the final grades to the registrar
Marsha Utech11/21/20029:02:45 PMWhen is the latest date that you will send final grades?
Haomin Wang11/21/20029:03:08 PMIf you send 5 assignments one day before I send in the final grades, I may not be able to read and grade them all. In that case, you may get an "I" grade
Haomin Wang11/21/20029:03:40 PMI think it's Dec 20
Cliff De Long11/21/20029:04:03 PMI'm throwing it right in the Tomcat directory of a terminal server - C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\jsp\ ... But, my question is, what would I put in a script to modify entries in the *.mdb file?
Marsha Utech11/21/20029:04:39 PMThank you, I am signing off now
Lisa Tolliver11/21/20029:05:00 PMHaomin, back to the arrays
Haomin Wang11/21/20029:05:03 PMYou mean changing data in a table?
Lisa Tolliver11/21/20029:05:09 PMshould we stop after 2?
Haomin Wang11/21/20029:05:23 PMOK. arrays
Haomin Wang11/21/20029:05:51 PMNow that you have the gorup of students lined up, you have an array
Haomin Wang11/21/20029:06:14 PMand you can pick any one of them by a sequence number
Haomin Wang11/21/20029:06:26 PMthat's like an array index value
Cliff De Long11/21/20029:06:38 PM[Private to Haomin Wang] I'll wait - just holler when ererybody else gets done.
Lisa Tolliver11/21/20029:06:57 PMSo would I have 6 different lines choosing 0, 1, 2, and some how the last three?
Lisa Tolliver11/21/20029:07:19 PMor just 0, 1, and 2 and then reverse the order and choose 0, 1, and2 again?
Haomin Wang11/21/20029:08:01 PMOK. Lisa. I'm copying an array here: String stateNames [] = {"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"};
Haomin Wang11/21/20029:08:28 PMHere's another: long stateAreas [] = {52423,656425,114006,53182,163707,104100,5544,2489,65758,59441,10932, 83574,57918,36420,56276,82282,40411,51843,35387,12407,10555,38192,86943, 48434,69709,147046,77358,110567,9351,8722,121593,54475,53821,70704,44828, 69903,98386,46058,1545,32007,77121,42146,268601,84904,9615,42769,71303, 24231,65503,97818};
Haomin Wang11/21/20029:08:50 PMEach state is separared from others by a comma
Paulette Mangold11/21/20029:09:08 PMgot that
Lisa Tolliver11/21/20029:09:43 PMI understand all of that clearly, I just don't get how to find 3 specific ones at a time instead of just one at a time
Haomin Wang11/21/20029:10:00 PMHold on. I'm pulling out another array
Haomin Wang11/21/20029:13:52 PMCan you access this page: http://www.courses.dsu.edu/cet756/lessons/Week12/states.htm
Paulette Mangold11/21/20029:14:11 PMyes
Lisa Tolliver11/21/20029:14:39 PMyes
Haomin Wang11/21/20029:14:51 PMOK. If you have this array (actually two arrays), can you easily pick out the three largest and three smallest?
Lisa Tolliver11/21/20029:15:09 PMright, I've figured out those 2 arrays
Haomin Wang11/21/20029:15:12 PMIf you scroll down, they are there
Paulette Mangold11/21/20029:16:24 PMok
Lisa Tolliver11/21/20029:16:36 PMI actually just wrote mine so they were in one table, but I used the area < and area > a certain number
Haomin Wang11/21/20029:16:37 PMIf we place them in two arrays: one named stateNames and the other stateAreas, we can then access the first three (smallest) by picking stateNames[0], stateNames[1], and stateNames[2]
Haomin Wang11/21/20029:16:56 PMand of course, stateAreas[0], stateAreas[1], and stateAreas[2]
Lisa Tolliver11/21/20029:17:21 PMwould that be a get... I can't remember the word
Haomin Wang11/21/20029:17:34 PMwhat about the last three (largest), given that we know the array size is 50?
Lisa Tolliver11/21/20029:17:36 PMMy book is at school
Lisa Tolliver11/21/20029:17:51 PM47,48, and 49
Lisa Tolliver11/21/20029:18:02 PMbut what if we don't know the array size?
Haomin Wang11/21/20029:18:08 PMstateStates[0] = request.getString("name")
Lisa Tolliver11/21/20029:18:21 PMthat's it - getString
Haomin Wang11/21/20029:18:29 PMstateNames[0] = request.getString("namej")
Lisa Tolliver11/21/20029:18:42 PMdo we write that 6 times?
Haomin Wang11/21/20029:18:54 PMstateAreas[0] = request.getLong("area")
Haomin Wang11/21/20029:19:03 PMof course not
Haomin Wang11/21/20029:19:09 PMuse loops
Lisa Tolliver11/21/20029:19:39 PMor stateNames[0,1,2,47,48,49] = request.getString("name")
Haomin Wang11/21/20029:19:39 PM arrIndex = 0; while(results.next()) { stateNames[arrIndex] = results.getString("name"); areaSize[arrIndex] = results.getLong("area"); arrIndex++; }
Haomin Wang11/21/20029:20:03 PMNo, you can't do that
Lisa Tolliver11/21/20029:20:06 PMok
Lisa Tolliver11/21/20029:20:46 PMbut when will the array stop?
Haomin Wang11/21/20029:20:52 PMyou can't cram so many numbers into the square brackets
Haomin Wang11/21/20029:21:12 PMwhen results has no more "next"
Lisa Tolliver11/21/20029:21:28 PMwon't that show all 50 then?
Paulette Mangold11/21/20029:21:36 PMthat's what I thought
Haomin Wang11/21/20029:21:56 PMin this case, we know the array won't go over 50, so we declare the array size to be 50
Lisa Tolliver11/21/20029:22:18 PMis that the arrIndex?
Haomin Wang11/21/20029:22:30 PMint stateAreas [ ] = new int [50]; String stateNames [ ] = new String [50];
Haomin Wang11/21/20029:22:58 PMyes. "arrIndex" is declared to be an integer
Haomin Wang11/21/20029:23:08 PMint arrIndex = 0;
Haomin Wang11/21/20029:23:42 PMit gets incremented each time the results set gets a record
Haomin Wang11/21/20029:24:08 PMso that the next record can be placed in the next element of the array
Lisa Tolliver11/21/20029:25:35 PMare you still in an array, or now in a loop?
Haomin Wang11/21/20029:26:08 PMarray and loop have to work together to display their power
Haomin Wang11/21/20029:26:31 PMHow can we go through an array most efficiently?
Haomin Wang11/21/20029:26:39 PMsay, the array has 100 elements
Haomin Wang11/21/20029:26:48 PMusing a loop
Lisa Tolliver11/21/20029:27:10 PMright, but what if we don't know how many elements are in the array?
Haomin Wang11/21/20029:27:36 PMfor (int k=0; k<100; k++) { println ( array[k] ); }
Lisa Tolliver11/21/20029:27:38 PMHow can we just ask "what are the three largest and the 3 smallest" and it will work in any database?
Haomin Wang11/21/20029:28:20 PMyou can use the property length to find out for (int k=0; k
Haomin Wang11/21/20029:28:43 PMk will never exceed the array length (size)
Lisa Tolliver11/21/20029:29:09 PMok, I actually understand that little bit
Haomin Wang11/21/20029:29:15 PMaccess the first thee and then the last three elements in the array
Haomin Wang11/21/20029:29:43 PMlet the loop run 3 times accessing the first three
Haomin Wang11/21/20029:30:02 PMand another loop 3 more times, but accessing the last three elements of the array
Lisa Tolliver11/21/20029:30:38 PMI think I might be able to figure out the first 3 by incrementing by one 3 times, but how would you find the last 3?
Haomin Wang11/21/20029:30:50 PMActually, I would put all the state names and areas into an array of 50
Lisa Tolliver11/21/20029:31:00 PMThat's what I did
Lisa Tolliver11/21/20029:31:07 PMwell, sort of
Haomin Wang11/21/20029:31:14 PMand then simplly write 6 states to retrieve the data from the array
Lisa Tolliver11/21/20029:31:30 PMI have them all in one table with the state names and areas in MAX or MIN order
Lisa Tolliver11/21/20029:32:06 PMgive me a hint on that one
Lisa Tolliver11/21/20029:32:17 PMI'm not following you
Haomin Wang11/21/20029:32:53 PMprintln(stateNames[0] + stateAreas[0]): println(stateNames[1] + stateAreas[1]): println(stateNames[2] + stateAreas[2]): ///////////////////////////////// println(stateNames[47] + stateAreas[47]): println(stateNames[48] + stateAreas[48]): println(stateNames[49] + stateAreas[49]):
Haomin Wang11/21/20029:33:39 PMThe query can select all states in ascending order: results = stmt.executeQuery("select name, area from states order by area");
Haomin Wang11/21/20029:33:47 PMordered by area
Lisa Tolliver11/21/20029:34:05 PMOHHHH, I was trying to find a way to say something with the statenames and stateAreas together, not separate like you put it.
Haomin Wang11/21/20029:34:26 PMint arrIndex = 0; while(results.next()) { stateNames[arrIndex] = results.getString("name"); areaSize[arrIndex] = results.getLong("area"); arrIndex++; }
Lisa Tolliver11/21/20029:34:31 PMthat's the exact statement I have in my script so far
Haomin Wang11/21/20029:34:53 PMdid you put them in arrays
Lisa Tolliver11/21/20029:35:16 PMI have: results = stmt.exectueQuery("select name, area from states order by area");
Lisa Tolliver11/21/20029:35:54 PMI think so, because it shows the table with all 50 states and their areas
Haomin Wang11/21/20029:35:57 PMyou need to put the results into arrays so that you can access the first three and last three by index values
Lisa Tolliver11/21/20029:36:05 PMoh...okay
Lisa Tolliver11/21/20029:36:18 PMso put the results from MAX and MIN in an array?
Haomin Wang11/21/20029:36:41 PMactually, there's a shortcut
Lisa Tolliver11/21/20029:36:46 PMor put the 50 state names in ABC order in an array with their respective areas?
Haomin Wang11/21/20029:36:51 PMno MAX or MIN needed
Lisa Tolliver11/21/20029:36:55 PMoh
Haomin Wang11/21/20029:37:54 PMWhen you display the results in a table, use a counter to display only # 1, 2, 3, and # 47, 48, and 49
Lisa Tolliver11/21/20029:39:11 PMwhere can I refresh my memory about counters/
Haomin Wang11/21/20029:41:55 PMint counter = 0; while(results.next()) { counter++; if (counter < 4 && counter < 47) { out.println("
" + results.getString("name") + "" + results.getLong("population") + "
Haomin Wang11/21/20029:42:45 PMI'm sorry; it should be: if (counter < 4 && counter > 46)
Lisa Tolliver11/21/20029:42:52 PMshouldn't that be" if
Lisa Tolliver11/21/20029:42:59 PMyep, that's what I was going to write
Haomin Wang11/21/20029:43:08 PMno, it should be: if (counter < 4 || counter < 47)
Haomin Wang11/21/20029:43:38 PMmeaning if counter is either less than 4 or counter is greater than 46
Lisa Tolliver11/21/20029:43:59 PMwouldn't it be counter > 47 (using the greater than sign)?
Haomin Wang11/21/20029:44:05 PMso the correct condition is: if (counter < 4 || counter > 46)
Paulette Mangold11/21/20029:44:17 PM I think counters are in chapter 8 of Deitel
Lisa Tolliver11/21/20029:44:25 PMok
Paulette Mangold11/21/20029:44:36 PMok
Haomin Wang11/21/20029:44:51 PMit'll display state names and areas only when the counter is 1, 2, 3, 47, 48, 49
Lisa Tolliver11/21/20029:45:07 PMI'm going to try to work on this much of it tomorrow, and I'll e-mail you if I have further questions
Paulette Mangold11/21/20029:45:13 PMthank you
Haomin Wang11/21/20029:45:27 PMcounter is only an integer that gets updated on a regular basis
Haomin Wang11/21/20029:45:43 PMOK
Lisa Tolliver11/21/20029:45:46 PMOne quick question
Lisa Tolliver11/21/20029:45:54 PMwhat if you don't know the length of the array?
Haomin Wang11/21/20029:46:18 PMyou can find it out by using the length property of an array
Lisa Tolliver11/21/20029:46:37 PMis there a way to just ask it to give you the last 3 in the length property?
Haomin Wang11/21/20029:46:56 PMarrayName.length should give you an integer value of the array's size
Lisa Tolliver11/21/20029:47:12 PMok
Haomin Wang11/21/20029:47:33 PMif arrayName.length is 50, you know the last three should be indexed as 47, 48, and 49
Haomin Wang11/21/20029:48:46 PMdo you think you've come to grips with arrays
Paulette Mangold11/21/20029:48:54 PMmuch better now
Lisa Tolliver11/21/20029:49:13 PMI think I can work with this for now. I'll try to see if I can get it and I'll get back to you.
Paulette Mangold11/21/20029:49:28 PMthank you very much
Paulette Mangold11/21/20029:49:38 PMnow I just have to apply it
Lisa Tolliver11/21/20029:49:41 PMI understand what arrays are, I just don't understand the script that goes with them and with displaying what I want
Haomin Wang11/21/20029:50:26 PMyou may need to refer to tonight's discussion scripts
Haomin Wang11/21/20029:50:44 PMI'll send it to you
Lisa Tolliver11/21/20029:50:47 PMI just thought there'd be an easy line or 2 or 3 or whatever to type in the script to find out the largest 3 and smallest 3 even if I didn't know there were 50 elements in my table
Paulette Mangold11/21/20029:51:09 PM[Private] I am saving the chat for future reference
Lisa Tolliver11/21/20029:51:19 PMOk, I'll save it also, in case someone loses it .
Lisa Tolliver11/21/20029:51:22 PMThanks for your help!
Haomin Wang11/21/20029:51:25 PMYou can use MAX and MIN to find the largest and smallest, but one of each
Paulette Mangold11/21/20029:51:38 PM[Private] sorry cliff
Lisa Tolliver11/21/20029:51:39 PMnot 3?
Haomin Wang11/21/20029:51:50 PMnot even 2
Lisa Tolliver11/21/20029:52:07 PMohhh, well, that's been my question. That's what I've been trying to do!
Haomin Wang11/21/20029:52:13 PMunless there are two with the same value
Lisa Tolliver11/21/20029:52:18 PMok
Lisa Tolliver11/21/20029:52:33 PMis next semester going to be a nightmare?
Lisa Tolliver11/21/20029:52:44 PMor worse?
Haomin Wang11/21/20029:52:49 PMdaymare as well
Lisa Tolliver11/21/20029:53:00 PMthanks for the encouragement!
Cliff De Long11/21/20029:53:05 PMsounds heavenly (not)
Haomin Wang11/21/20029:53:12 PMbecause you may keep thinking of your program during the day as well
Lisa Tolliver11/21/20029:53:29 PMI am already having daymares!!
Paulette Mangold11/21/20029:53:34 PMI already try to program in my sleep and they still don't work
Lisa Tolliver11/21/20029:53:35 PMand not sleeping at night!!
Haomin Wang11/21/20029:54:04 PMI can have programming dreams sometimes and get good ideas in dreams
Lisa Tolliver11/21/20029:54:06 PMI thought this was an introductory class?? :)
Haomin Wang11/21/20029:54:39 PMIt is. We haven't reached the professional level yet
Paulette Mangold11/21/20029:54:43 PMI wish
Lisa Tolliver11/21/20029:55:03 PMPlease tell me we won't meet that level next semester either.
Haomin Wang11/21/20029:55:25 PMno. You'll need more than a degree program for that
Lisa Tolliver11/21/20029:55:38 PMgood!!!!!!!!!
Lisa Tolliver11/21/20029:56:04 PMok, well I'm going to bed!
Haomin Wang11/21/20029:56:09 PMThose undergraduates in compugter science are not necessarily professionals when they graduate
Paulette Mangold11/21/20029:56:17 PMI am going to sign off and hopefully have those good dreams.
Lisa Tolliver11/21/20029:56:22 PMThanks for all your help!
Paulette Mangold11/21/20029:56:30 PMyes thank you very much
Haomin Wang11/21/20029:56:31 PMdepending on how much they really know and can do
Haomin Wang11/21/20029:56:48 PMOK. Good night now
Lisa Tolliver11/21/20029:56:49 PMAnd where are the "professional level courses?"
Haomin Wang11/21/20029:57:08 PMNo courses for professionals
Lisa Tolliver11/21/20029:57:28 PMtraining?
Haomin Wang11/21/20029:57:35 PMprofessionals come into being through experiences
Lisa Tolliver11/21/20029:58:21 PMI wish I could have a small enough experience to get me through this year!
Cliff De Long11/21/20029:58:25 PMpractice makes faster - not perfect...
Haomin Wang11/21/20029:58:30 PMIf one has only book knowledge, with limited experience, one cannot claim to be a professional
Lisa Tolliver11/21/20029:58:59 PMgood night.
Haomin Wang11/21/20029:59:23 PMbye now
Haomin Wang11/21/20029:59:38 PMCliff: you have questions, right?
Cliff De Long11/21/20029:59:53 PMSo, can I just throw a little access database up in C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\jsp
Haomin Wang11/21/200210:00:17 PMThat'll be a very bad idea
Cliff De Long11/21/200210:00:25 PMwhy?
Haomin Wang11/21/200210:00:47 PMsince that's the directory for web scripts and you can even place HTML pages there
Cliff De Long11/21/200210:01:07 PMWhere should I put it then?
Haomin Wang11/21/200210:01:24 PMdatabase is usually placed in a directory that people would have little clue to
Haomin Wang11/21/200210:01:53 PMyou can create a directory on your C drive or D drive and place it there
Cliff De Long11/21/200210:02:12 PMOK, once it is there
Haomin Wang11/21/200210:02:26 PMwhen you use Access, the default folder for databases is "My Documents"
Haomin Wang11/21/200210:02:49 PMfor our course, whichever directory is fine
Cliff De Long11/21/200210:03:07 PMright, but I want to transfer the file from a workstation that has access to a server that doesn't...
Haomin Wang11/21/200210:03:16 PMin real use, the database directory is one that is out of web access range
Cliff De Long11/21/200210:03:55 PMright, My SQL 7 server is on a different box from the WebServer that accesses it
Cliff De Long11/21/200210:04:08 PMvia ODBC
Haomin Wang11/21/200210:04:17 PMyou can move a database across different computers, what specifies the path is the DSN
Cliff De Long11/21/200210:04:57 PMagain, right - given that the DSN and ODBC tags point to the correct database
Lisa Tolliver11/21/200210:04:58 PM[Private] Cliff, I'm going to bed, but wanted to tell you thanks for being so patient through my questions.
Cliff De Long11/21/200210:05:17 PM[Private to Lisa Tolliver] Good night girl - sleep well
Haomin Wang11/21/200210:05:30 PMthen locations don't matter, if DSN is set
Cliff De Long11/21/200210:05:47 PMWrite a JSP script to create a table that stores information of students in a class you teach. We'll use the student information stored in this table in the next two weeks as a base to check student logins, generate a quiz from the database (on US states) for them to take, and store student performance records. So, design the students table accordingly. Email me the screen shots of your table structure, like the one we saw in this week's lesson notes, but yours doesn't have to mirror this.
Cliff De Long11/21/200210:06:32 PMagain, right - I use a central access database that multiple workstations access in order to schedule videoconferences
Haomin Wang11/21/200210:07:16 PMAccess database won't allow any external access
Cliff De Long11/21/200210:07:18 PMso, in your example, you gave an image of an access database, I'm confused that it would be jsp accessible by field name
Haomin Wang11/21/200210:07:40 PMYou can place both your scripts and Access database in the same site
Cliff De Long11/21/200210:07:49 PMsure, as long as the drive is mapped, it appears local
Haomin Wang11/21/200210:08:25 PMIt's not the drive; it's the site
Cliff De Long11/21/200210:09:26 PMI'll try it - will you be around this weekend?
Haomin Wang11/21/200210:09:30 PMa field name can be in any database. It has nothing to do with DSN
Haomin Wang11/21/200210:10:01 PMI'll be in Saturday, and will be out most of Sunday
Haomin Wang11/21/200210:10:30 PMI'll check emails Saturday noon
Cliff De Long11/21/200210:11:36 PMOK - I get it now, I was confusing MySQL with MSAccess
Cliff De Long11/21/200210:12:28 PMjust set up the ODBC tag to point at the *.mdb file, and the JSP script should be able to modify the actual database...
Haomin Wang11/21/200210:12:53 PMI'd suggest you stick with Access for a while if you can. Tackle MySQL only when you have enough of Access or Access is not available. MySQL requires you to write lots of text commands
Cliff De Long11/21/200210:13:13 PMData Source Name = pathname/*.mdb
Haomin Wang11/21/200210:13:37 PMActually, it's not JSP that's modifying database, but SQL statements
Cliff De Long11/21/200210:13:52 PMStructured Query Language
Haomin Wang11/21/200210:14:04 PMSQL statments can run from most programming languages as long as you have access to a database
Haomin Wang11/21/200210:14:30 PMright
Cliff De Long11/21/200210:14:37 PMIt just got a lot easier - good night and have a good weekend! :)
Haomin Wang11/21/200210:14:44 PMOK
Haomin Wang11/21/200210:14:56 PMhave a good one!