JSP with Microsoft Acess

Hi,
Could please help to debug what are the problems with my below code? I have a form in HTML with two text box (Username and Password). I use JSP to retrieve the value from those two text box and put in the table of Microsoft Access. My Microsoft Access file is Auction.mdb and my Table name is tblUsername. Since i am new to JSP and SQL language then i dont know if my all my codes are complet or not.
The below are my JSP codes:
<HTML>
<BODY>
<%@ page language="java" import="java.sql.*" %>
<%  String url = "jdbc:odbc:Auction", user="", passwd=""; %>
<%     Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver"); %>
<%--<%     Connection myConn = DriverManager.getConnection (url, user, passwd); %> --%>
<% Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb"); %>
<%     Statement myStatement = myConn.createStatement (); %>
<% String StrUser = request.getParameter("username"); %>
<% String StrPass = request.getParameter("password"); %>
<%     ResultSet myResult = myStatement.executeQuery("INSERT INTO tblUserName([UserName], [Password]) VALUES ('StrUser', 'StrPass')"); %> 
<% myConn.close(); %>
</BODY>
</HTML>-----------------------------------------------------------------
And the belows are my HTML
<html>
<head>
<title>Welcome to the Action...</title>
</head>
<body>
<form action="user_register.jsp" method="post">
Username:<input type="text" name="username">
Password:<input type="password" name="password">
<input type="submit" name="okfunc" value="OK">
</form>
</body>
</html> Could you please advise? Because i always get problems while trying to enter data.
Thanks,
Kimsan

Hi,
I have another problems now. I am trying to get data back from my table and display in my page, but i always have problems. I dont know what are going wrong with my code. It also alert that the variable "i" in while loop cannot be resolved. The below are my code:
<HTML>
<BODY>
<%@ page language="java" import="java.sql.*" %>
     <% Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver"); %>
     <% Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb"); %>
     <%     Statement myStatement = myConn.createStatement (); %>
     <%     ResultSet myResult = myStatement.executeQuery("SELECT * FROM tblProduct"); %>
     <%     ResultSetMetaData myData = myResult.getMetaData (); %>
     <%     for (int i=1; i<= myData.getColumnCount(); i++) %>
     <p align="center">List of products which are available:</p>
     <table width="640" border="1" align="center" bordercolor="#7188e0">
     <tr bgcolor="d1d1ff">
     <th width="30">Product Name</th>
     <th width="30">Product Price</th>
     <th width="30">Product Quanity</th>
     <th width="90">Product Description</th>
     </tr>
     <% while(myResult.next()) %>
     <% { %>
          <% for (int i=1; i<= myData.getColumnCount(); i++) %>
               <tr bgcolor="#f8f8f8" >
               <th><%= myResult.getString(i) %></th>
               </tr>
     <% } %>
     <% myConn.close(); %>
</BODY>
</HTML>Could you please advise what are the problems??
B.Regards,
Kimsan

Similar Messages

  • Integration with Microsoft Acess database

    This might seem like a very general question, but I am trying to connect a User Registration database I made in Microsoft Access to Dreamweaver CS4. Can anyone help me? It would be very appreciated! I've been having a lot of trouble...makes me sad at night...

    As you say, it's a general question which is not easily answered in a forum such as this. Many books have been written on the subject.
    Helpful responses can be provided if you tell us what you've done so far and specifically what you're having problems with.

  • JSP with Microsoft sql Server 2005 Studio Express

    I have a database named CS352 in MSSQL 2005 Express version, I am using Tomcat 5.5, I am trying to connect to this database with jdbc driver jtds-1.2, but I can't connect, here is the code for the connection
    Class.forName("net.sourceforge.jtds.jdbc.Driver");
    java.sql.Connection con = java.sql.DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/CS352");
    it gives error for the second part
    java.sql.SQLException: Network error IOException: Connection refused: connect, what should I do to connect to database please help it is very urgent.

    when I say telnet 127.0.0.1 1433 or telnet localhost 1433 it say connection can not established destination computer rejects, what could I do to solve this problem, or how can I connect to mssql with a different approach, maybe using jdbc:odbc what is the diference if someone explain the differences and how can I cnnect with odbc or to solve the problem above (localhost1433 is not reachable), thanks for the help.

  • Interface jsp application with microsoft outlook

    hi friends,
    i have a requirement in one of my project.
    the project is something like this..
    my jsp page contains some fields
    like
    To:
    Subject:
    & many others....
    now i want my jsp application to communicate with microsoft outlook,
    wher i press submit on my jsp page & all the data entered in the jsp page should replicate in my outlook & from here i can send across the mails..is it possible....or is there any other way i can send mails using my jsp application..
    expecting ur replies to tackle intrestin problem
    thanks in advance
    Ganesh BS

    hi,
    check with this code.....if u have outlook its well N good..other it works with other mail systems like yahooo...(only thing u need is internet)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <%@page language="java" %>
    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript">
    function mailsome1(){
    who=prompt("Enter recipient's email address: ","[email protected]");
    what=prompt("Enter the subject: ","none");
    bod=prompt("enter text","");
    if (confirm("Are you sure you want to mail "+who+" with the subject of "+what+"?")==true){
    parent.location.href='mailto:'+who+'?subject='+what+'?textbody='+bod+'';
    </SCRIPT>
    </head>
    <body background="background1.JPG";>
    <a href='javascript:mailsome1()'>E-Mail Someone!</a>
    <FORM>
    <input type=button value="E-Mail Someone!" onClick="mailsome1()">
    </FORM>
    </body>
    </html>

  • How to Install Visual Studio 2010 on a PC with Microsoft Office 2013 with 64 bits

    I am with problems to have acess to the link: http://www.microsoft.com/en-us/download/details.aspx?id=12187
    Why?
    I want do install Visual Studio 2010 on a PC with Microsoft Office 2013 with 64 bits. How can I do it?
    Thanks.

    Hello Carla Sofia,
    Visual Studio installation do not depends on Microsoft Office 2013. They do not have relationship here. I think your problem is that you cannot find the link to install Visual Studio 2010.
    In order to know why, please see here:
    https://support.microsoft.com/en-us/lifecycle/search/default.aspx?sort=PN&alpha=Visual%20Studio%202010&Filter=FilterNO
    The mainstream support for Visual Studio 2010 is already expired and that is why you cannot open any link about Visual Studio 2010 Setup.(I cannot verify whether that link is about VS2010 Setup.)
    I think you need to think about the following:
    1. If you need Visual Studio 2010, you may have to consider some other channels. For example, official site you can try use MSDN Subscription. For non-official site. Sorry I cannot provide any place for you
    2. You can use other latest version of Visual Studio, for example, we have Visual Studio 2012, 2013, 2015 for you to use. You can also use Visual Studio Express 2010 version. It is still available for download.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • When i login with microsoft account cannot access with administrative share c$

    i have a problem when i login to windows with microsoft account cannot access any network computer with administrative sharing c$,d$ with windows 8.1 
    but when i login with local account can access
    and some people tell  me create key in regedit t fix it 
    after enter user name and password show this error 
    and i apply your instruction  and not fix until now
    note:
     my Machine windows 8.1 if another machine in network windows 7 can access a hidden share if machine in network windows 8.1 show this message in image 2 
    but if i login with local user can i access all machine hidden share network windows 7 and 8.1

    yes this computer i want to access  name poland2-work and have two users 
    first :administrator
    second : poland 2

  • Is there a way to create form fields to tab into and type and or drop down selection fields in pages as you can with microsoft word?

    is there a way to create form fields to tab into and type and or drop down selection fields in pages as you can with microsoft word?

    No

  • Does iWork come with a form of powerpoint presentation compatible with Microsoft Office Powerpoint?

    I recently bought a MacBook Pro and need to purchase iWork or Microsoft Office. Does iWork come with a form of powerpoint presentation? If so, is it easy to use and compatible with Microsoft Office presentation software? The latter question is extremely important as we use Microsoft Office primarily at the college.

    Yes, Keynote is iWork's PowerPoint equivalent. You can save as a PowerPoint file as well. Very easy to use IMO.

  • Unit Testing with Microsoft Sharepoint Emulators and Fakes with Visual Studio 2013

    Hi All,
    I have created Test Project and now creating Test cases for Sharepoint. I found a link on MSDN which suggests using Fakes framework but it supports VS2012 and I am using Visual Studio 2013.
    So how can I use it with VS2013 or is there any other way with which I can implement the Test cases with VS2013.
    Please suggest.
    Thanks in advance.
    Himanshu Nigam

    Hi HimanshuNigam,
    According to your descrition, my understanding is that you want to use Fakes framework to create test case for SharePoint project in Visual Studio 2013.
    If you want to test using Fakes Framework, you can use the codeplex extension to achieve it. It supports Visual Studio 2013.
    Here is a detailed article for your reference:
    Better Unit Testing with Microsoft Fakes
    About how to include the Nuget package, you can use the package with the link below:
    NuGet Package Manager for Visual Studio 2013
    Installing NuGet
    If you still have question about this issue, I suggest you can create a post in Visual Studio, more experts will help you and you can get more detailed information from there:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=visualstudio%2Cvsarch%2Cvsdbg%2Cvstest%2Cvstfs%2Cvsdata%2Cvsappdev%2Cvisualbasic%2Cvisualcsharp%2Cvisualc
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • A datasheet component compatible with Microsoft Sharepoint Foundation 2010 is not installed error

    I have 2013 Office installed and using 2010 SharePoint Foundation.
    The button 'Datasheet View' is available on the site but when clicked on I get this error:
    The list cannot be displayed in Datasheet view for one or more of the following reasons:
    - A datasheet component compatible with Microsoft SharePoint Foundation is not installed.
    - Your Web browser does not support ActiveX controls.
    - A component is not properly configured for 32-bit or 64-bit support.
    I have installed and repaired the Office Suite already, ActiveX is enabled in the browser etc.
    I have also enabled the Microsoft Add-ons.
    Installed on Windows Server 2008 R2.
    How can I solve this issue?

    Hi,
    1. The Edit
    in Datasheet view functionality in SharePoint Server 2010 is not supported if you install
    64-bit Office 2013 client. The Edit in Datasheet functionality
    is available if you install 32-bit Office 2013 client
    http://technet.microsoft.com/en-us/library/ee681792.aspx
    2. Edit in data sheet view is not supported in 64 bit version of the i.e.
    If I understand correctly you are trying to access site from the Windows server 2008 R2, the default OS installation will have two browsers. Open internet explorer that doesn't have (64 bit) in the bracket. The one with 64bit is not supported
    http://office.microsoft.com/en-us/sharepoint-foundation-help/use-datasheet-view-in-64-bit-office-2010-HA101882420.aspx
    Regards Murali

  • Error An unexpected error has occurred. Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: 65ef1cb8-1cbf-40ee-b79b-05db15ca6dbb

    Hi, 
    Since I installed a few updates, that I can't access the sharepoint the same way. I always get errors when trying to access the majority of the pages.
    I already removed the update suggested on other threads (KB2844286), but everything remains the same.
    I always receive errors like this one:
    Error
    An unexpected error has occurred.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: 65ef1cb8-1cbf-40ee-b79b-05db15ca6dbb
    what can I do? The Sharepoint 2010 is located on a virtual partition of our server, running Windows Server 2008 Standard edition SP1.
    When I try to access administration tools it happens the same error, and I don't know what I can do more. 
    Please help me.
    best regards,
    Jorge Guimarães

    I followed some tips, to trace the error, allowing some trace debug, and got this:
    Server Error in '/' Application.
    Object reference not set to an instance of an object.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
    Source Error: 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace: 
    [NullReferenceException: Object reference not set to an instance of an object.]
    Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties() +134
    Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs() +44
    Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext) +329
    Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalAvailable() +44
    Microsoft.Office.Server.WebControls.MyLinksRibbon.EnsureMySiteUrls() +60
    Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalMySiteUrlAvailable() +15
    Microsoft.Office.Server.WebControls.MyLinksRibbon.OnLoad(EventArgs e) +91
    System.Web.UI.Control.LoadRecursive() +65
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Control.LoadRecursive() +190
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427
    Version Information: Microsoft .NET Framework Version:2.0.50727.5477; ASP.NET Version:2.0.50727.5479

  • Sign in with Microsoft account not responding

    I have problem with skype sign in with Microsoft account. When I click on sign in with Microsoft account, in version 7 skype freezes and not respond and in version 6 it stays in loading and not respond. I tried to uninstall completely and reinstall, delete the share.xml and all of the available solutions. None of them have worked! It's worth to mention that I have no problem with Android version.

    Please,  run the DirectX diagnostics tool.
    Go to Windows Start and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post.
    Be aware that you will have to zip this file before attaching it here.

  • Can't login to Skype with Microsoft account

    Hello!
    My problem is I can't login to Skype (website and program both) with Microsoft account. When I try to login to Skype on website, it says: There is a problem signing in with Microsoft account. Please try again or sign in with Skype details instead.
    Please help me, I tried so many things and nothing works...

    And me. And I tried to reset my password by getting the "password token" emailed to me. Once received I clicked on the link to reset my password and it told me that my "password token wasn't recognized" and to enter it manually. I did that, going as far as to cut and paste the token, and it wasn't "recognized" again.
    And when I was able to sign in, I couldn't get any new contacts, even though I knew they were presently signed in.
    Bring back Windows Live!

  • Login to WebApi (MVC + WebApi) with Microsoft Account from Windows Store App

    Hi
    How can I access a WebApi Controller (ASP.NET MVC+WebApi) that is secured with Microsoft Account from a Windows Store App?
    I have no idea how to login. I tried the LiveSDK but this gives me only access to OneDrive, Callender and so on.
    Could someone please point me in the right direction.
    Thanks
    Guenter

    Hi Guenter,
    To be clear, you are using Microsoft account as login and at same time you have your own REST service for other functionalities?
    Let's say if you login with LiveSDk, you should be able to get some access token, see this for more information:
    Signing users in, after that use the token to access your REST service, as I understand REST service is a kind of http request, we can use HTTPClient to request data from the address.
    I'm afraid there is no existing sample here but the only thing I found is HTTPClient sample:
    https://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664, you can use POST to send your token information to the server.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Been sat here for the past 5 hours trying to figure out why itunes wont download, it says error and something to do with Microsoft? Help me please.. getting a bit bored?

    been sat here for the past 5 hours trying to figure out why itunes wont download, it says error and something to do with Microsoft version? Help me please.. getting a bit bored?

    i have this problem too
    my dad thinks its because itunes is getting overloaded

Maybe you are looking for

  • IPad2 freezing (not OS5 related, I promise!)

    Hi, I'm having some troubles with my ipad2.  I, at some point, pretty much filled it up in terms of space.  That might have something to do with my issue. When I plug it in to sync/update, itunes just freezes.  It sees the device, but any attempt to

  • Customer previous account no.

    Hi, In customer master under accounting tab Previous account no. is there. Question is, how it is assign to site code.Can some explain me in detail and T code to create site code and how to assing customer previous account number and site code. Regar

  • IOS beta 2 expired phone tells me to connect it to itunes

    Hi im a developer and I have ios 6 beta 2 on my 3gs. Unfortunatley I didnt have time or Internet to update it to 6.0; This morning I wake up and the phone is locked! Tells me to connect it to iTuens. or connect to a wifi hotspot. My wifi doesnt work

  • Disk utility check

    Any reason to be alarmed by any of these messages? Particularly the SUID warning? Repairing permissions for "Macintosh HD" Reading permissions database. Reading the permissions database can take several minutes. Warning: SUID file "System/Library/Cor

  • How to "include" another page or servlet in a standard servlet

    How can I achieve a "include" in a servlet? From what I see... the include() method is on the PageContext class, which is in org.apache.somewhere... right?? Or am I missing something? thanks