<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Java</title>
        <link>http://www.theruntime.com/blogs/jaykimble/category/162.aspx</link>
        <description>Java</description>
        <language>en-US</language>
        <copyright>Jay Kimble</copyright>
        <managingEditor>jkimble@gmail.com</managingEditor>
        <generator>Subtext Version 1.9.5.0</generator>
        <item>
            <title>An Answer to my post for young programmers</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/06/24/an-answer-to-my-post-for-young-programmers.aspx</link>
            <description>&lt;p&gt;My good buddy (actually my best friend from High School), "The Witt" complained that I wasn’t being helpful to programmers who are trying to learn the craft when I posted two weekends ago on "&lt;a href="http://theruntime.com/blogs/jaykimble/archive/2008/06/14/a-question-you-should-ask-when-hiring-a-non-entry-level.aspx"&gt;A Question you should ask when hiring a non-entry level developer&lt;/a&gt;." (OK, he wasn’t the only one... but, hey, we have a history, so he can get me to post a response, and you can’t... deal...) &lt;/p&gt;  &lt;p&gt;I decided that our subsequent conversation in email would make a good followup post for those who want to know what they should be doing, and with his blessing I am posting an edited version.&lt;/p&gt;  &lt;p&gt;[It started with this comment]&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;The Witt - &lt;em&gt;OK I know that I am new to the ASP codeing info.       &lt;br /&gt;I understand the security issues ( or at least, what might happen with leaving every thing wide open). BUT, Having just completed two semesters of nothing but ASP I just don’t see what wrong... I AM NOT a seasoned programmer...and my classes taught us to connect inthis very manner you discribe...        &lt;br /&gt;can you eleborate for those of us that are trying to learn? show us what you would do instead?        &lt;br /&gt;thanks in advance&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Jay (in Email now)- I know I probably made some harsh statements there (in my blog post). I meant it to be hard, but it was as much about seeing some consultant coming in and writing crappy code against my APIs and leaving HUGE security holes in my website.&lt;/p&gt;  &lt;p&gt;The major point is for ASP.NET that you should always use Command objects with parameters... something like this (code may not compile cause its off the top of my head... there’s probably an error in there somewhere...)&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; query &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; = &lt;span style="color: #006080"&gt;"select field1, field2, field3 from someTable where ID = @TableID"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; Cmd.CommandText = query&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; Cmd.Parameters.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DbParameter(&lt;span style="color: #006080"&gt;"TableID"&lt;/span&gt;, cbo.Value)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #008000"&gt;' Code continues....&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The trick is in using the "@" variable in the query, and using the Parameters collection. When this gets shoveled down to the database it gets sent differently and if someone tries to change that "cbo.Value" within the http post by trying to add their own SQL it will fail.&lt;/p&gt;

&lt;p&gt;I know that changing the variable in the http post statement sounds advanced... go here --&amp;gt; &lt;a href="http://www.bayden.com/TamperIE/"&gt;http://www.bayden.com/TamperIE/&lt;/a&gt;, download the TamperIE tool (for IE)  and try it out... You’ll see that you can in fact force whatever values you want into the post.&lt;/p&gt;

&lt;p&gt;As far as other dev environments go (I know you deal with a couple others), you want to figure out how to send a prepared statement to whatever SQL Server you are dealing with (ms access has these as well, so does Oracle and everything else I can think of... even the free PostgreSQL has them). &lt;/p&gt;

&lt;p&gt;Anyway, I see you as someone who’s growing as a developer... you’d not go into an interview and present yourself as more than you are... that too is the problem...&lt;/p&gt;

&lt;p&gt;Do you mind if I post this (more or less?) as a new blog post?&lt;/p&gt;

&lt;p&gt;&lt;font color="#008000"&gt;The Witt- I don’t mind in the least…&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#008000"&gt;          Like I said I am trying to learn. The “@” tucked in front… I always thought that was just to get the info from the current page. It’s nice to know what that really does. I do use that for most of my sites. I just never knew all the reasons.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#008000"&gt;I think that is the problem with a lot of the schools today. They are just pushing the students out and they really don’t know what they are doing. (Not that I always know what I’m doing). &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;---------------&lt;/p&gt;

&lt;p&gt;Ok. it’s not all that edited. One more thing I forgot to mention. If you use an ORM or something that builds classes for you, then you probably are getting this type of functionality (just about every ORM I know of uses prepared SQL statements to push data). My favorite ORM is SubSonic (and I know others rave about NHibernate)... It the Java world I use Apache Cayenne (and people rave about Hibernate over there)&lt;/p&gt;

&lt;p&gt;---------------&lt;/p&gt;

&lt;p&gt;BTW, I take great pleasure in mentioning that The Witt turns $28 (that’s hex) in a little less than 2 months... unfortunately I turn $28 about 2 weeks before him.&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2429.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/06/24/an-answer-to-my-post-for-young-programmers.aspx</guid>
            <pubDate>Wed, 25 Jun 2008 01:15:35 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2429.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/06/24/an-answer-to-my-post-for-young-programmers.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2429.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Necessary Evil??</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/05/09/necessary-evil.aspx</link>
            <description>I want to write today about the 300lb Gorilla that none of us really wants to talk about. I'm talking about the people we use to find new jobs. As you may be aware I closed down &lt;a href="http://intradynamics.net"&gt;IntraDynamics, LLC&lt;/a&gt; (well, I have greatly curtailed my company's offerings),and got a new job (at &lt;a href="http://www.answers-sys.com"&gt;Answers Systems, Inc.&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
I was "exchanging notes" with my new boss regarding the process and discovered some things (none of this is surprising, but you may want to think about it next time you are pursuing a new job). &lt;br /&gt;
&lt;br /&gt;
I had two recruiters that were aware of my interview process with Answers. One was the company who placed me and the other was a company I trusted (in the past) who appeared to be working hard to place me somewhere else (even asking about where I was in the process with Answers). In fact I was actually told that Answers (who offered me a job in less than a week) was slow in their hiring process. All this makes sense (the other recruiting company was trying to get the fees for me and wanted to do the placement with Answers, so they needed me out of the way). They inappropriately asked Answers about me.&lt;br /&gt;
&lt;br /&gt;
There's that side of things. The other is that it took a long time to get my deal finalized (almost another week). Why? Recruiter placement fees. Now mind you there was a slight change in things with me (I went from "contract to hire" to just "hire"). The company wanted as much as 35% of my yearly salary for placing me (now mind you it wasn't because they did a great job finding me, etc.. they were in the right place at the right time).&lt;br /&gt;
&lt;br /&gt;
To be honest all Answers needed was someone else to pre-screen candidate's technical abilities. All that the placement firm did was monitor Monster.com and send out an email. There were a few additional things they did (like call me everyday regardless of whether there was new info or not).&lt;br /&gt;
&lt;br /&gt;
I don't mean to be trashing on someone (that's why I left the company names out), but I was in shock of the fees they wanted to collect. My boss, Perry, and I started talking about what would be better.&lt;br /&gt;
&lt;br /&gt;
Eric Wise' idea of having a computer programmers trade association seems like a good idea. We would pay dues, but the organization would allow us to take tests and "prove" our abilities (or at least allow it to be easier to pre-screen applicants). Maybe there would also be a mechanism for referring. &lt;br /&gt;
&lt;br /&gt;
I've been thinking about this. We could do it now you know. We could set up a site to create the organization. There would need to be a set of testing sub sites (maybe you would only be allowed to test every 6 months or every year). When the companies we work for are looking for people we could simply look in the organizations site to see who is currently available and match up test thresholds to what we are looking for. We could then refer these folks to our companies avoiding the whole recruiting industry.&lt;br /&gt;
&lt;br /&gt;
Maybe I'm just dreaming...&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2405.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/05/09/necessary-evil.aspx</guid>
            <pubDate>Fri, 09 May 2008 19:30:01 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2405.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/05/09/necessary-evil.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2405.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>