I am working on a project for a class and am a beginner at using the JDBC. For one part, my instructor wants us to "provide  a  query  menu  that  allows  a  user  to  input  query  command  and  retrieve information from the database." I have researched quite a bit and am unable to find a way to do this. Most examples I have seen already know what the user is going to be querying. If I am allowing the user to query anything, how can I return the correct information? The code I have so far is below.  System.out.println("What table do you wish to query?"); table = scan.nextLine(); System.out.println("What values do you wish to query? Type them separated by commas. If you wish to select all values, please type a *."); values = scan.nextLine(); System.out.println("Type the conditions for your WHERE clause, excluding the keyword WHERE."); conditions = scan.nextLine(); query = "SELECT " + values + " FROM " + table + "WHERE " + conditions; try {     stmt = con.createStatement();     ResultSet rs = stmt.executeQuery(query);     while (rs.next()) {         if(values != "*")            String results = rs.getString(values);     }   There is where I am stuck because I have no idea what the user is going to query so I do not know what to put in the while loop, as in this example where they know the user is looking for last names.  rs = stmt.executeQuery("SELECT Lname FROM Customers WHERE Snum = 2001"); while ( rs.next() ) {     String lastName = rs.getString("Lname");     System.out.println(lastName); }   Any help or suggestions would be greatly appreciated.
With java.sql.ResultSet is there a way to get a column's name as a String by using the column's index? I had a look through the API doc but I can't find anything.
Should I really have been awarded mortarboard on a Per-site meta? latexmk: jobname option and clean up incompatibility? I'm using  in a Makefile to compile my document. Since I want my output filename to be different from the input filename, I use latexmk's option jobname.  The problem is: it seems to be incompatible with latexmk -c to clean temporary files.  Here's the specific entry in my Makefile:  these.pdf: header.tex $(OBJS)     latexmk                 \         -pdf                \         -pdflatex="$(TEX)"  \         -jobname="these"    \         -use-make $&lt;   Input files are header.tex containing the latex instruction header and other latex content files. The output files are these.{aux,bbl,bcf,...}. Then latexmk -c does not remove temporary files: .{aux,bbl,bcf,...} files. How do you make USB bootable on chromebook I have a chromebook series 5. I want to install Ubuntu onto a USB stick. When I downloaded Ubuntu onto my USB stick, it won't start up.  Do I first have to download Ubuntu onto my chromebook hard drive, open Ubuntu and then make USB stick bootable? And then return back to chrome?  Or is there a way to download directly onto USB and make the stick bootable?  I appreciate any help. How to add days to current Date using JavaScript. Does JavaScript have a built in function like .Net's AddDay? "Me and Joey's" or "mine and Joey's" Which of the following should I use?     Today is me and Joey's anniversary   Today is mine and Joey's anniversary Movie/TV series, which bullets carried DNA of the shooter Can someone tell me how to get a closed form for  $$\sum_{k=1}^n k^p$$  For $p = 1$, it's just the classic $\frac{n(n+1)}2$.   What is it for $p &gt; 1$? How to tell if a  tag failed to load I'm dynamically adding &lt;script&gt; tags to a page's &lt;head&gt;, and I'd like to be able to tell whether the loading failed in some way -- a 404, a script error in the loaded script, whatever.  In Firefox, this works:  var script_tag = document.createElement('script'); script_tag.setAttribute('type', 'text/javascript'); script_tag.setAttribute('src', 'http://fail.org/nonexistant.js'); script_tag.onerror = function() { alert("Loading failed!"); } document.getElementsByTagName('head')[0].appendChild(script_tag);   However, this doesn't work in IE or Safari.  Does anyone know of a way to make this work in browsers other than Firefox?  (I don't think a solution that requires placing special code within the .js files is a good one. It's inelegant and inflexible.) Under the  tag I have seen many questions on earth-616. Are there any other versions of earth as well? How do they differ from each other? I noticed that when I had a helium filled, latex balloon inside of my car, it moved forward in the cabin as I accelerated forward. The faster I accelerated forward, the faster the balloon went from the back of the car to the front of the car. The balloon didn't have a string.  This became a game with my 4 year old as we drove home. We figured out where the balloon would go based on how fast I accelerated, turned corners etc.  I expected that it would act a lot like the water in a cup does, but it was the total opposite it seemed.  What forces caused this behavior?  I assumed it has something to do with the fluid dynamics in the closed cabin, but I can't figure it out. How to call shell script from php that requires SUDO? Satisfying explanation of Aristotle's Wheel Paradox. The paradox:    We have a circle and there is another circle with smaller radius. They are co-centeric.  If circle make full turn without sliding, both smaller and bigger circle make full turn too. If we assume that the passed road is equal to the circumference of circles. We have got smaller circle's radius is equal to bigger one's.  Unsatisfying Solutions I found:    "Do not assume that smaller circle's circumference is equal to passed road since the surface that contacts to the ground is bigger one. " // Okey but it does not explain the paradox, it explains just what is the wrong assumption (even does not explain why it is a wrong assumption.) It is undeniable that every point on both smaller and bigger circle will contact exactly one and only one point on their path. Therefore we can think that this is a bijective maps and smaller circle is isomorphic to bigger one. (Okey but ....)   Question: What is the true answer? What is wrong with the definition of circumference of a circle and relationship with its taken path. What is the purpose of wrapping whole Javascript files in anonymous functions like “(function(){ … })()”? Let $n \in ℕ$. Show that the ring $ℤ/nℤ$ is a field if and only if $n$   is prime.   Let $n$ prime. I need to show that if $\bar{a} \neq 0$ then $∃\bar b: \bar{a} \cdot \bar{b} = \bar{1}$. Any hints for this ?  Suppose $ℤ/nℤ$ is a field. Therefore: for every $\bar{a} \neq 0$ $∃\bar b: \bar{a}\cdot \bar{b}=1$. How can I show that $n$ must be prime ? Java error: Implicit super constructor is undefined for default constructor Nature of the quantum degeneracy pressure Consider repeated measures ANOVA (RM-ANOVA) with one within-subject factor A and several measurements per subject for each level of A.  It is closely related to two-way ANOVA with two factors: A and subject. They use identical decomposition of the sum of squares into four parts: A, subject, A⋅subject, and residual. However, two-way ANOVA tests the effect of A by comparing SS of A with the residual SS, while RM-ANOVA tests the effect of A by comparing SS of A with the A$\cdot$subject interaction SS.   Why the difference?    Does this difference automatically follow from the repeated-measures structure of the data, or is it some convention?  Does this difference between two-way ANOVA and RM-ANOVA correspond to testing two different nulls? If so, what exactly are they and why would we use different nulls in these two cases? Two-way ANOVA's test can be understood as an F-test between two nested models: the full model, and the model without A. Can RM-ANOVA be understood in a similar way?   (If there is only one measurement per subject for each level of A, then the distinction sort of disappears because A$\cdot$subject and residual variation cannot be disentangled: )    Demonstration  I will use toy data d2 generated in . The same webpage shows correct syntax for RM-ANOVA.  # Discarding between-subject factors and leaving only one within-subject factor d = d2[d2$Xb1=='CG' &amp; d2$Xb2 == 'f', c(1,4,6)]   (See reproducible version .) Data look like that:       id Xw1     Y 1    s1   A  28.6 2    s1   A  96.6 3    s1   A  64.8 4    s1   B 107.5 5    s1   B  77.3 6    s1   B 120.9 7    s1   C 141.2 8    s1   C 124.1 9    s1   C  88.0 10   s2   A  86.7 ...   Here is two-way ANOVA: summary(aov(Y ~ Xw1*id, d))               Df Sum Sq Mean Sq F value   Pr(&gt;F)     Xw1           2  95274   47637  16.789 3.73e-07 *** id           19  31359    1650   0.582    0.913     Xw1:id       38  71151    1872   0.660    0.929     Residuals   120 340490    2837                    Here is RM-ANOVA: summary(aov(Y ~ Xw1 + Error(id/Xw1), d))  Error: id           Df Sum Sq Mean Sq F value Pr(&gt;F) Residuals 19  31359    1650                 Error: id:Xw1           Df Sum Sq Mean Sq F value   Pr(&gt;F)     Xw1        2  95274   47637   25.44 9.73e-08 *** Residuals 38  71151    1872                       Error: Within            Df Sum Sq Mean Sq F value Pr(&gt;F) Residuals 120 340490    2837               Note the identical SS decomposition, but two-way ANOVA tests Xw1 against the residual, while RM-ANOVA tests Xw1 against the Xw1:id interaction.  Why?  This question is related to . If we try using Error(id) instead of Error(id/Xw1) in the example above, then Xw1 will get tested against Xw1:id interaction lumped together with the residual variation.  (The same issue arises in factorial RM-ANOVA with multiple within-subject factors, where each factor or interaction is tested against its own "error term" aka "error stratum". These error strata are always given by the corresponding interaction with the block/plot/subject variable id.) How reliable is validating email domain by reverse DNS MX record checking Do you need to take the Hide action when you are Invisible, make no noise and leave no traces? The Situation: Lets say you are under the effect of Invisibility.  An invisible creature is impossible to see without the aid of magic or a special sense. For the purpose of hiding, the creature is heavily obscured. The creature's location can be detected by any noise it makes or any tracks it leaves.  And you are wearing the Boots of Elvenkind  While you wear these boots, your steps make no sound, regardless of the surface you are moving across. You also have advantage on Dexterity (Stealth) checks that rely on moving silently.  Now your groups ranger or druid casts Pass Without Trace on you.  [...] can’t be tracked except by magical means. A creature that receives this bonus leaves behind no tracks or other traces of its passage.  My Question(s): I know that when you are Invisible and you did not hide, you are still detectable because of the noise and the track you leave behind. But the Boots of Elvenkind and Pass Without Trace take care of that. So:  Are you still required to take the hide action in this situation if you don't want enemies to know your location/presence? If so, why? What gives away your location? If not and you are under the effect of greater Invisibility do you get the benefits of &quot;Unseen Attackers and Targets&quot; for every attack you make when you move between attacks? (You would give away your location, but are not detectable, so completely hidden again when you move) Cancellation of Direct Products