Can you please apply comments upon my coding tech....

I use a servlet to send data from a form to a Mysql database.
The servlet code is the following.
When i submit the form i receive an Error 500 from Tomcat upon the 69th line of the code.
The code has as follows.
package mypackage;
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class GroupRegistration extends HttpServlet
Connection con;
public void doPost (HttpServletRequest req, HttpServletResponse res)
                         throws ServletException, java.io.IOException
     handleForm(req, res);
public void init() throws ServletException {
     try{
     /* Loading the driver for the database */
     Class.forName("com.mysql.jdbc.Driver");
     Connection con = DriverManager.getConnection("jdbc:mysql://localhost/se?user=luser&password=Ztgtkpz2");
     catch (ClassNotFoundException e) {
     throw new UnavailableException("Couldn't load JdbcOdbcDriver");
     catch (SQLException e) {
     throw new UnavailableException("Couldn't get db connection");
     private void handleForm(HttpServletRequest req, HttpServletResponse res)
     throws ServletException {
     //ServletOutputStream out = res.OutputStream();
     //res.setContentType("text/html");
     //Extract the form Data Here
     String group = req.getParameter("GroupNo");
     String Name1 = req.getParameter("Name1");
     String LoginID1 = req.getParameter("LoginID1");
     String Name2 = req.getParameter("Name2");
     String LoginID2 = req.getParameter("LoginID2");
     String Name3 = req.getParameter("Name3");
     String LoginID3 = req.getParameter("LoginID3");
     String Name4 = req.getParameter("Name4");
     String LoginID4 = req.getParameter("LoginID4");
     String URL = req.getParameter("URL");
     String Title2 = req.getParameter("Title2");
     String date = req.getParameter("date");
     String INSERT = "INSERT INTO registration (groupno, name1, loginid1, name2, loginid2, name3, loginid3, name4, loginid4, url, topic, date) VALUES (" + group + "," + Name1 + "," + LoginID2 + "," + Name2 + "," + LoginID2 + "," + Name3 + "," + LoginID3 + "," + Name4 + "," + LoginID4 + "," + URL + "," + Title2 + "," + date + ")";
     PreparedStatement pstmt = null;
     try{
LINE69     pstmt = con.prepareStatement(INSERT);
     pstmt.executeUpdate();
     catch (SQLException e) {
     throw new ServletException(e);
     finally {
     try {
     if (pstmt != null)pstmt.close();
     catch (SQLException ignored){
Can you please recomend a solution to my problem.
If i mange to overcome the bug do you have any suggestions upon connection pooling or anythink that will make it to run smoothly?
Thank you for your time.

This is not how u use preparedStatement. You need to read the documents.
Moreover what are you going to do with the alpahanumeric fields in your database, Dont you have to encode them in codes.
When you insert the value for a field which is a string you have to enclose it with codes

Similar Messages

  • Hi i am working with indesign on a book in hebrew. and the page numbering that i apply. showing from left to right insted of right to left. can you please help?  thank you. iris

    hi
    i am working with indesign on a book in hebrew. and the page numbering that i apply. showing from left to right insted of right to left.
    can you please help?
    thank you. iris

    Hi Shawninglewood,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    How to delete content you've downloaded from the iTunes Store, App Store, iBooks Store, or Mac App Store
    http://support.apple.com/kb/HT5772
    Cheers,
    - Judy

  • My illustator crashes when i try to save  can you please help?

    My illustator crashes when i try to save  can you please help? im using Cs6

    Archelass,
    If the crashing happens when placing from/saving to new location with Yosemite, you maybe able to get round it by using the Adobe Dialog instead of the OS Dialog in the Place window (similarly for Save As in the Save As window).
    If crashing happens when moving objects, the issue may be caused by the Chrome Pushbullet extension, see this post #3 by Matt with the solution,
    https://forums.adobe.com/message/6984777#6984777
    or by the Adobe Color extension, see this post #2 byhexxstatic with the solution,
    https://forums.adobe.com/message/7095368#7095368
    or by the cache on the computer, see post #5 in this thread by Booklover with the solution,
    https://forums.adobe.com/thread/1696375
    Or, when issues start to appear in general you may try the list.
    The following is a general list of things you may try when the issue is not in a specific file, and when it is not caused by issues with opening a file from external media. You may have tried/done some of them already; 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save current artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to at least 5 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible), for CS3 - CC you may find the folder here:
    https://helpx.adobe.com/illustrator/kb/preference-file-location-illustrator.html
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall (ticking the box to delete the preferences), run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • Highlighter has not been working in Adobe reader in my samsung Galaxy Tab 3.  Can you please help?

    Highlighter has not been working in Adobe reader in my samsung Galaxy Tab 3.  Can you please help?

    Update to comment - I found this thread that is related:
    Did Adobe Acrobat Reader revert to this bad and nonintuitive way to highlight text? The highlight approach described in this thread - to select text with handles - does work, but it is truly slow and clumsy.
    https://forums.adobe.com/thread/1538670

  • Can you please tell me how can i change the parameter of Applet using Aspec

    Respect Members
    Can we apply Aspectwerkz on Applet? In our project we have to
    change the method parameters before its execution(Around Advice) , can we do this in applet using Aspectwerkz?
    Can you please tell me how can i change the parameter of Applet using Aspectwerkz or AspectJ ?
    I did it by for Java Application using the AspectJ And Aspectwerkz But not able to do for Applet.
    For Applet I Am setting the parameter in JAVA plug in for Aspectwerkz e.g. -Xdebug -Xrunaspectwerkz -Xbootclasspath & path for xml file in which pointcut is defined.
    If you any Friend working on it or any author who might be helpfull for me please Forward this mail to him/her
    THANKs in Advance
    [email protected]

    hello rodale, what you're seeing is probably a side effect of firefox not being able to save certain preferences into its profile folder.
    go to ''firefox > help > troubleshooting information'', click on ''profile folder/show folder'' and close all firefox windows afterwards. a windows explorer window should open up - in there delete the file named '''user.js'''.
    in case this didn't solve the issue yet please also refer to [[How to fix preferences that won't save]].

  • I have just changed to Firefox from IE. When i pull up my home page which is the BBC.co.uk I have always to reset my local region as it always defaults to London. I didn't have this problem with IE. Can you please supply a solution, thank you

    I have just changed to Firefox from IE. When i pull up my home page which is the BBC.co.uk I have always to reset my local region as it always defaults to London. I didn't have this problem with IE. Can you please supply a solution.

    I fixed it!!! Following advice from similar posts, I searched the hard drive for "sessionrestore.js" in my Firefox Profiles folder (you'll need to enable viewing of hidden files in Windows Explorer (Tools > Folder Options > View (then select Hidden files option) then Apply to all folders) to do this). I then shut down Firefox, deleted the file and restarted - my home page was correct and it didn't try to open my old session! Some other posts suggested deleting everything called "sessionrestore" in that folder, but I didn't need to.

  • Can you please recomend a better solution than this?

    I use a servlet to send data from a form to a Mysql database.
    The servlet code is the following.
    When i submit the form i receive an Error 500 from Tomcat upon the 69th line of the code.
    The code has as follows.
    package mypackage;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class GroupRegistration extends HttpServlet
    Connection con;
    public void doPost (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, java.io.IOException
    handleForm(req, res);
    public void init() throws ServletException {
    try{
    /* Loading the driver for the database */
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost/se?user=luser&password=Ztgtkpz2");
    catch (ClassNotFoundException e) {
    throw new UnavailableException("Couldn't load JdbcOdbcDriver");
    catch (SQLException e) {
    throw new UnavailableException("Couldn't get db connection");
    private void handleForm(HttpServletRequest req, HttpServletResponse res)
    throws ServletException {
    //ServletOutputStream out = res.OutputStream();
    //res.setContentType("text/html");
    //Extract the form Data Here
    String group = req.getParameter("GroupNo");
    String Name1 = req.getParameter("Name1");
    String LoginID1 = req.getParameter("LoginID1");
    String Name2 = req.getParameter("Name2");
    String LoginID2 = req.getParameter("LoginID2");
    String Name3 = req.getParameter("Name3");
    String LoginID3 = req.getParameter("LoginID3");
    String Name4 = req.getParameter("Name4");
    String LoginID4 = req.getParameter("LoginID4");
    String URL = req.getParameter("URL");
    String Title2 = req.getParameter("Title2");
    String date = req.getParameter("date");
    String INSERT = "INSERT INTO registration (groupno, name1, loginid1, name2, loginid2, name3, loginid3, name4, loginid4, url, topic, date) VALUES (" + group + "," + Name1 + "," + LoginID2 + "," + Name2 + "," + LoginID2 + "," + Name3 + "," + LoginID3 + "," + Name4 + "," + LoginID4 + "," + URL + "," + Title2 + "," + date + ")";
    PreparedStatement pstmt = null;
    try{
    LINE69 pstmt = con.prepareStatement(INSERT);
    pstmt.executeUpdate();
    catch (SQLException e) {
    throw new ServletException(e);
    finally {
    try {
    if (pstmt != null)pstmt.close();
    catch (SQLException ignored){
    Can you please recomend a solution to my problem.
    If i mange to overcome the bug do you have any suggestions upon connection pooling or anythink that will make it to run smoothly?
    Thank you for your time.

    Look where you try to populate the connection variable con:
    try{
    /* Loading the driver for the database */
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost/se?user=luser&password=Ztgtkpz2");
    Notice that you redeclared Connection con as a local variable.
    try this instead:
    try{
    /* Loading the driver for the database */
    Class.forName("com.mysql.jdbc.Driver");
    con = DriverManager.getConnection("jdbc:mysql://localhost/se?user=luser&password=Ztgtkpz2");

  • Unable to sync iMac address book with iPad. Can you please help?

    Unable to sync iMac address book with iPad. Can you please help?

    I have the same problem as Sheilaza but haven't been able to solve it using the advice offered.  The same problem applies to my Calendars. When I look at my iPad settings in iTunes, it says:
    Sync Contacts
    Your contacts are being synced with your iPad over the air from iCloud.
    Over-the-air sync settings can be changed on your iPad.
    and the same for Calendars.
    On the iPad, in iCloud settings, I have checked 'Contacts' and 'Calendars' as 'ON' but the Calendar remains blank and the Contacts are a very old version that was somehow created when I set up the iPad initially.
    Any ideas?
    Thanks.

  • HT1848 I don't know if you all realize but iTunes has been updated more than five times so can you please update your information on how to transfer apps form a IOS device to iTunes please

    I don't know if you all realize but iTunes has been updated more than five times so can you please update your information on how to transfer apps form a IOS device to iTunes please

    Please be aware that you are not communicating with Apple when you post in these forums. Most of the people who will reply to your posts are, like me, your fellow users.
    As to your comment, I don't know what it is you're referring to, but if you believe a support article is incorrect, you can tell Apple about it here:
    https://ssl.apple.com/support/feedback/
    Regards.

  • HT4528 My IPhone Bugged out/It is currently in the reset mode. I need to exchange all of my contacts from my Yahoo acct. to my new IPHONE. Can you please help me?

    Hello ,
    I purchased my IPHONE about 2 months ago. I am visiting family in DE & this tuesday it starting to go off & on by itself. Then the icons looked like they were floating . Then I could not call or text . The SIRI device would not work. Then it would shut down then the apple icon would reappear. I took it to a verizon dealer in Rehoboth DE & they said it BUGGED OUT/It is in a RESTORE MODE. It will not turn on. We could not transfer anny of my pics or contacts. I never even had a chance to back up the memory on ITUNES.
    The tech @ Verizon said to contact APPLE to trouble shoot and try and transfer the contacts from my yahoo acct.
    Can you please help?
    Gina

    set up your yahoo account in mail, contacts, calendars as an Exchange Account and you should be able to get your contacts from Yahoo from there.

  • Can you please take a look at my TM Buddy log and opine on what the problem is?

    Pondini,
    Can you please take a look at my TM Buddy log and opine on what the problem is?  I'm stuck in the "Preparing Backup" phase for what must be hours now.  My last successful backup was this morning at 7:16 am.  I did do a series of Software Update this morning, one of which, a security update I believe, required a restart.
    I'm confused as to what the issue is, and how to get everything back to "it just works".
    Many thanks in advance.
    Starting standard backup
    Backing up to: /Volumes/JDub's Drop Zone/Backups.backupdb
    Error: (5) getxattr for key:com.apple.backupd.SnapshotState path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotContainer path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotState path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotContainer path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotState path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotContainer path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotState path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotContainer path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotState path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotContainer path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotState path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotContainer path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotState path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotContainer path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotState path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Error: (5) getxattr for key:com.apple.backupd.SnapshotContainer path:/Volumes/JDub's Drop Zone/Backups.backupdb/Jason Wisniowski’s iMac/2013-05-30-002104
    Event store UUIDs don't match for volume: Area 420
    Event store UUIDs don't match for volume: Macintosh HD
    Error: (5) getxattr for key:com.apple.backupd.SnapshotSt

    Time Machine can't read some data it needs from your backups (each of those date-stamps is one of your backups). 
    That's usually a problem with the drive itself, but could be the directory on it. First be sure all plugs are snug and secure, then see if you can repair it, per #A5 in Time Machine - Troubleshooting. 
    If that doesn't help, post back with the results.  Also either tell us what kind of Mac you have, what version of OSX you're running, or post that to your Profile, so it's accessible.  
    This is unrelated to the original post here, so I'm going to ask the Hosts to split it off into a new thread.  Since you've posted in the Lion forum, I'll assume that's what you're running.  You should get a notice from them

  • Can you please put me in touch with the support  for the trial copy of adobe acrobat XI pro which I had tried out on March 15 for 30 days. I have  been trying to cancel since the cost is too much and Acrobat Reader is OK for me. I can't find uninstaller.

    Can you please put me in touch with the support  for the trial copy of adobe acrobat XI pro which I had tried out on March 15 for 30 days. I have  been trying to cancel since the cost is too much and Acrobat Reader is OK for me. I can't find uninstaller.
    I have had to erase my disk since then with trouble with Apple Store not recognising my machine and the reload from Time Machine has given complications . Can you please cancel my trial and return my Trial money.

    If you paid for what you used then it was not a trial.
    Look thru the following links and use the chat option if required for your situation:
    Cancel your membership or subscription | Creative Cloud
    https://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html
    https://forums.adobe.com/thread/1703848
    Chat support - For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Creative Cloud support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html ( http://adobe.ly/19llvMN )
    Phone support | Orders, returns exchanges
    http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • Lightroom 5 defaulted to my Trial version. Can you please advise on what I did wrong? I can provide the serial number for the purchased subscription.

    History - I had a 30 day trial version of Lightroom back in October. One small catalog of 1500 photos were contained in it. When I was prompted to upgrade, I incorrectly selected the option to "choose a different catalog" which prevented me from seeing my recent photos in Lightroom 5. It appears that my version of Lightroom may be a trial version instead of the version for my subscription purchase. Can you please help me with this? I will be glad to provide the serial number as necessary.

    Without proper system info and other details nobody can tell you anything. for the time being, try another browser...
    Mylenium

  • My ipod touch is stuck on the 4.2.1 software, its a 3rd gen as well i was just wondering why i can not get the lastest update can you please help me with this issue

    i have been having an issue with updating my ipod touch for some time now and i can not seem to get it to update to the lastest update. it is stuck on 4.2.1 software and i can not update it to 4.3 or any other ios software update. can you please help me to solve this issue.

    It sounds like you actually have a 2G iPod Touch which can only go as high as iOS 4.2.1.  If it's an 8 GB iPod Touch it's definitely a 2G iPod Touch as there was never such a thing as a 3G 8 GB iPod Touch. See this article to help verify what generation iPod Touch you have.
    Identifying iPod models
    B-rock

  • I wanted to update my itunes and it didn't update and now it wont open so i had to uninstall it and it wont install now at all can you please help?

    Hi
    I turned on my laptop this evening to import a new cd but it asked me if i wanted to download the new version of itunes so i went ahead to update it but it failed to update then it failed to open at all, and and runtime error keeps popping up but when i uninstalled it to reinstall it it wont install now and i cant use my ipod or ipad with my laptop without itunes and i never had this problem at all. can you please help?

    Hey maryncomiskey,
    Thanks for the question. I understand you are experiencing issues with the latest iTunes update. The following resource may help to resolve your issue:
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Additional Information:
    How to restart the Apple Mobile Device Service (AMDS) on Windows
    http://support.apple.com/kb/TS1567
    Thanks,
    Matt M.

Maybe you are looking for

  • Company Logo does not appear in Excel and HTML, but appears in PDF and RTF

    Hi, I have a RTF template with my Company Logo Embedded. When I run the report from Standard Request Submission, and I give the output type as Excel or HTML, I dont see the Logo on my report. When I give the output type as PDF or RTF, then I see the

  • How to restrict keyfigures in transfer structure?

    hi, i have 10 key figures(fields) in my data source,but i want to restrict 5 keyfigures of these 10kf (2nd,4th,6th,8th,10th kf's which i want restrict).will be displayed rest of 5 keyfigures. condition should be in transfer structure not in updaterul

  • Activity step is not visible in workflow log

    Hi All. I added two task  in my workflow and transported it to qualityand it got transpported successfully. then i triggered the workflow and when i am checking the log one of my task is not visible in my log. Please guide me in this. Thanks in  adva

  • How do use my ITunes balance to pay for Apps

    How do use my ITunes balance to pay for Apps?

  • Trash issue/question

    I'm afraid to empty my iPhoto's trash because there could be one or two pics in there that I actually want. I thought I could just make a new album, move all the pics that are in the trash into the new folder, then trash the ones I know I don't need,