JSP and Access 2007 database

i've been trying to look for codes on how to access the Access 2007 database (.accdb).
i've done a previous JSP app with Access database, but it is of a lower version (.mdb).
i need something like the following, but for the 2007 version. is it just a matter of changing the extension for both statements, or is there more to it?
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String DBQ = request.getRealPath("sales.mdb");
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + DBQ + ";DriverID=22;READONLY=true";thanks.

<%@page import="java.sql.*" %>
<table boder="1">
<%
Statement statement;
Connection conn;
String url = "jdbc:mysql://localhost/dbName";
String user = "username";
String pass = "password";
try {
    class.forName("com.mysql.jdbc.Driver");
    conn = DriverManager.getConnection(url, user, pass);
    statement = conn.createStatement();
String query = "SELECT images FROM database";
ResultSet results = statement.executeQuery(query);
while(results.next()) {
%>
    <tr>
        <td><img src="<%= results.getString("images") %>"></td>
    </tr>
<% } %>
</table>The while loop will loop through your result set and print the table row for each image it finds in the query.
Hope this helps,
Jon

Similar Messages

  • Connecting Dreamweaver to Access 2007 database

    Hi, I am relatively new to Dreamweaver CS3; I have built a
    database in MS Access 2007; I'm looking to do either of the
    following;
    1. Put the database form on the web, so users can enter
    information straight into the database or/
    2. Create a front end form in Dreamweaver and link it to my
    database
    Ideally, I would like to do #1
    This is an internet website, not an intranet website.
    Any help would be appreciated as I am growing frustrated.
    Thanks,
    Raymond!

    matthew stuart wrote:
    > I guess ASP may be the easiest to learn because all you
    need to do is insert
    > your windows XP disk an install IIS (Internet
    Information Services). This
    > enables you to serve ASP pages locally for testing.
    That makes ASP easy to install, but ease of installation does
    not
    necessarily mean ease of learning.
    > learning it
    > is a different kettle of fish which is why I say get a
    book. The current books
    > seem to be mainly php with MySQL, but the older books
    seem to be ASP with
    > Access or MySQL.
    There's a very good reason for that. Microsoft stopped
    developing ASP in
    2000. Although ASP is widely supported, and will continue to
    be for the
    foreseeable future, it's a technology that's going nowhere.
    Anyone just
    starting out to learn how to build a database-driven website
    would be
    better advised to learn one of the technologies that remain
    in active
    development. That means ASP.NET - which has a steeper
    learning curve
    than ASP - ColdFusion, or PHP.
    Another important consideration is which database to use.
    Access is not
    designed to be used on a website. It works fine for small
    websites that
    don't get many visitors, but it creates bloated files, and
    locks up when
    traffic increases. Although MySQL and Microsoft SQL Server
    are more
    difficult to learn, they are a much better option for a
    website.
    I'm biased in favour of PHP and MySQL because I write books
    about them,
    but I would seriously advise Jedi7 to choose anything other
    than Access/ASP.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Error Connecting to Access 2007 database

    Hi there,
    We are seeing the below error when trying to Connect to Access 2007 using Crystal 2008, when using the
    Access/DAO connection wizard ..
    Logon failed
    Details: DAO Error Code: 0xd0f
    Source: DAO.Workspace
    Description: Unrecognised database format 'path to database\crs project database.aaadb
    When we go to open the Access 07 file we have to select all files\there is no Option for Access 2007
    Maybe we need to install something additional?
    Many thanks
    Jon Kerr

    Look for Product info for our next version to see if it added to supported platforms for the next release of Crystal Reports.
    Update:
    Confirmed that Microsoft is not enhancing the DAO engine so we will not be updating our connector either. ODBC and OLE DB work great.
    Even More info form our Product Team:
    Just to be really clear - Microsoft is not exposing Access 2007 format databases (.accdb files) via DAO. They have declared DAO dead and are not enhancing it. OLEDB is the preferred way to connect to Access 2007 files.
    As noted in the Platform Support document for Crystal Reports 2008:
    DAO technology cannot be used to access the Microsoft Office 2007 file formats: Microsoft Access 2007 .accdb, Microsoft Excel 2007 .xlsx (XML) and .xlsb (Binary). These file formats are supported using the Microsoft 2007 Office System drivers for ODBC and OLEDB.
    Anyone can download the Microsoft 2007 Office System drivers for ODBC and OLEDB, here:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en
    There is no charge for those drivers. Of course if you have Office 2007 installed, you donu2019t need to download the drivers.
    Starting with Office 2010, there will be 64-bit versions of these drivers, which will help our 64-bit Visual Studio customers.
    Edited by: Don Williams on Feb 4, 2010 12:12 PM
    Edited by: Don Williams on Feb 8, 2010 5:59 AM

  • Acrobat and Access 2007

    I got 2 problems, when i have an access 2007 report and use the function "create and attach to email", on the following mail window, i want that the transmission confirmation and the return receipt check boxes are activated already, unfortunately Outlook 2007 settings have nothing to do with it.
    Well, i have to send 40-50 reports each day by email, so it's kinda annoying to hit those 2 check boxes for every mail.
    Another problem, after i've sent the mail, the mailwindow isn't closing automatically, i have to close it every time by hitting the X button. Thats annoying too.
    Before, i used Acrobat 7 and Office 2003, and the mail window was closed after sending each time, now with Acrobat 9 and Office 2007 it isn't anymore :(
    Anyone got a solution for these problems?
    Kind regards and merry xmas.
    Chris

    The first problem which you mentioned is more likely a MS Outlook bug. Try this. Launch Word and open any document. Now go to 'Office Button-> Send-> Email' option. This will create a new mail window with attached word document. Now check the options for transmission confirmation and the return receipt in the mail. Both of them are unchecked. So it's outlook which is not honoring the settings. This behavior is reproducible from MS Access as well (Office button-> Email option). Please check with MS support on this issue. Thanks.

  • I'm having issues with oracle ODBC and access 2007

    Hello all,
         I'm having an issue with using an ODBC connection with a pass-through query in access 2007. I have Oracle 9i installed and am on Windows 7 32 bit. This only seems to be effecting Windows 7 users and not XP users.
    The error in the SQL Log is this.
    CLDemoFE        1694-162c EXIT  SQLDriverConnectW  with return code -1 (SQL_ERROR)
      HDBC                0x00787430
      HWND                0x000501FC
      WCHAR *             0x6D3A8B34 [      -3] "******\ 0"
      SWORD                       -3
      WCHAR *             0x6D3A8B34
      SWORD                       -3
      SWORD *             0x00000000
      UWORD                        0 <SQL_DRIVER_NOPROMPT>
      DIAG [NA000] [Microsoft][ODBC driver for Oracle][Oracle]ORA-01019: unable to allocate memory in the user side (1019)
      DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed (0)
      DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed (0)
    I've been looking all over the internet and can't find an answer to the issue and decided to post it to see what other people thought.
    Thank you in advance.

    I've had exactly the same problem for weeks now.   When using Safari, it stalls, freezes, then starts working again.  I checked the console and exactly when it freezes.  I get the following:
    2015-02-25 5:51:59.000 PM kernel[0]: process com.apple.WebKit[405] caught causing excessive wakeups. Observed wakeups rate (per sec): 216; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 849849
    and:
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.FC16A539-929A-43E5-91EB-34A5669B70FD[1265]) Could not terminate job: 3: No such process
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.FC16A539-929A-43E5-91EB-34A5669B70FD[1265]) Using fallback option to terminate job...
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.1004D4B5-112D-4D90-9779-B2BEFB570C7F[1262]) Could not terminate job: 3: No such process
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.1004D4B5-112D-4D90-9779-B2BEFB570C7F[1262]) Using fallback option to terminate job...
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.9F72A6A1-63F5-41B2-B02F-40D4CB0925A2[1261]) Could not terminate job: 3: No such process
    2015-02-25 9:21:46.834 PM com.apple.launchd[1]: (com.apple.WebKit.WebContent.9F72A6A1-63F5-41B2-B02F-40D4CB0925A2[1261]) Using fallback option to terminate job...
    2015-02-25 9:21:46.864 PM com.apple.launchd[1]: (com.apple.WebKit.Networking.8CDDD2D1-B6B6-4F09-B8DE-5C4A4E9F653E[1260]) Exited with code: 1
    2015-02-25 9:21:46.998 PM com.apple.launchd[1]: (com.apple.WebKit.Plugin.64.39152B03-68E5-463E-A6C0-A9734AF733A2[1268]) Exited with code: 1

  • JSP and Images with database

    Ok, I have looked around on posts on this forum but still haven't come across an answer. I am trying to create a simple jsp page that contains some thumbnail images. The image locations are stored in a mysql database (e.g. http://www.somewhere.com/images/image1.jpg"). Assuming that I didn't know how many images were stored in the mysql table, how can I set up a jsp page that will automatically retreive all the image locations from the database and put the appropriate tags in the jsp to display all the images in an html table? In other words, I am trying to avoid writing in the jsp page a bunch of <tr><td><img src=.....></td></tr> statements. Do I need to do this with a tag library? You help is much appreciated! Let me know if I need to be more clear.
    Keith

    <%@page import="java.sql.*" %>
    <table boder="1">
    <%
    Statement statement;
    Connection conn;
    String url = "jdbc:mysql://localhost/dbName";
    String user = "username";
    String pass = "password";
    try {
        class.forName("com.mysql.jdbc.Driver");
        conn = DriverManager.getConnection(url, user, pass);
        statement = conn.createStatement();
    String query = "SELECT images FROM database";
    ResultSet results = statement.executeQuery(query);
    while(results.next()) {
    %>
        <tr>
            <td><img src="<%= results.getString("images") %>"></td>
        </tr>
    <% } %>
    </table>The while loop will loop through your result set and print the table row for each image it finds in the query.
    Hope this helps,
    Jon

  • Livecycle Designer 8.2 and Access 2007

    work in engineering... we have a change process that we have to go through to make a change on our product. I have a form - ECR that I can send to an engineer to start the process. I fill in the ECR #, the product name and the date (there are lots of other fields but I want to keep this simple). They fill in the reason they need the change and what it is.
    I have an MS Access Dabase that I have written to store the information.
    I have been able to sucessfully get the form to populate with "my input" from the database (ECR #, name, date). I can distribute it to the engineer and they can fill in "their input" (reason and change) and they can submit it back to me.
    Here is where my questions begin.
    How can I, once I receive back the form, get the reason and change information into the Access Database? Is there even a way to do this directly? I will be the only one to have access to the database. I just need to know if there is a way for the form and the database to "communicate" so the form places the "reason/change" information back into the correct record in the table.
    Ideally I would like to click on a button that I placed on the form and have some sort of statement that tells the form to "connect" to the database where the form ECR # = the database ECR # but so far the only thing that happens is that it opens the connection and the text in my form "reason/change" field goes away. (I assume because the database "reason/change" field is empty in the database and the form is updating to the database instead of the database updating to the form).
    I have searched for a solid week on this topic and cannot find the answer. I have gone through all of the tutorials that I can find regarding database and pdf but I can only find references and examples for drop down boxes, not fields. Can anybody point me in the right direction, or at the very least tell me it cannot be done so I can go find another way to accomplish what I need to get done.
    Thank you in advance for any information.
    Jenn D.

    The issue is that you have set up the connect to the db to be connected as soon as the form is loaded. You will want to delay the connection to the db until you are ready. There is a delayed open checkbox on the last page of the connection wizard. Set this on. To update the db you will have to write a sql statement to execute. Once the sql statement has been executed you will need to do an update command to commit the data. If you post your email address I can send you a sample that shows the different commands and how to enter the sql statement into the connection set.

  • Applet and access a DataBase

    hi. i need to access a data base located in a server from an applet, so, it will refresh some values that are shown in the web browser.
    i need some suggestions
    thanks in advance
    David

    The easiest method is JSP's or servlets, use HTML forms to update the database tables. Applets make it harder cus of the security issues, im sure you did a search before posting this question (hint, hint).
    If you have to use applets then you will run into all the problems that eveyone else has posted in this forum.
    Rob.

  • MHP and access to Databases

    Hello, I'm developing a MHP 1.0.3 application with Osmosys. The application provides patient the posibility to book an appointment with their hospital. I have finish the GUI of my applicattion and now I'm working in another issue.
    I need to connect to a database to read some fields of a table (where I have stored some information about the hospital). I think that I need JDBC Optional Package CDC. Am I right?
    About Databases: Do I need to work with Db4o or can I choose MySQL?
    Obviously I have and ADSL connection to work with the return channel.
    If somebody has an code example about this, post it please.
    Thank you

    Here you are an example of reading some text from a servlet that access to a database:
    I have copied this method from: http://www.cineca.tv/labs/mhplab/index-en.html
    public static String readHttp(String s)
    String s1 = null;
    if(connected)
    try
    URL url = new URL(s);
    HttpURLConnection httpurlconnection = (HttpURLConnection)url.openConnection();
    httpurlconnection.setDoInput(true);
    LineNumberReader linenumberreader = new LineNumberReader(new InputStreamReader(httpurlconnection.getInputStream(), "UTF-8"));
    s1 = "";
    String s2 = linenumberreader.readLine();
    do
    if(s2 == null)
    break;
    try
    s1 = s1 + s2 + "\n";
    s2 = linenumberreader.readLine();
    continue;
    catch(Exception exception1) { }
    break;
    } while(true);
    System.out.println("MXRc:response: " + s1);
    httpurlconnection.disconnect();
    catch(Exception exception)
    exception.printStackTrace();
    System.out.println(exception);
    return s1;
    The URL is the string that you use to access to your servlet, you always may use GET method to send explicitely the parameters: http://localhost/WebApp/Servlet?param1=3324&param2=23423....
    If the servlet returns a String you can obtain it via readHTTP method,ok?
    If you have more problems ask me again
    Abel

  • Can we connect and access SAP database using db adapter?

    Hi,
    I need couple of details:
    1) Can we connect to SAP database using db adapter and run select query to extract data from the SAP database tables?
    2) Where can I download SAP adapter? How to install it? and how to plug that in to the JDev?
    Cheers

    1) Can we connect to SAP database using db adapter and run select query to extract data from the SAP database tables? It is possible as long as back-end DB version of SAP are supported by DB adapter. Oracle recommends SAP connectivity through Oracle Application Adapter for SAP rather than direct connection to SAP Database tables.
    2) Where can I download SAP adapter? How to install it? and how to plug that in to the JDev?http://www.oracle.com/technology/products/integration/adapters/pdf/DS_OracleASAdapter_SAP.pdf
    http://www.oracle.com/technology/software/htdocs/devlic.html?url=/technology/software/products/ias/htdocs/101202.html
    http://download.oracle.com/docs/cd/E12524_01/doc.1013/e14201/toc.htm (Installation)
    http://download.oracle.com/docs/cd/E12524_01/doc.1013/e14196/toc.htm (SAP adapter configurtation)
    Manoj

  • Crystal Reports and Access database connection error

    I had this in a different forum with no hits, so I am trying this one.
    A person that I work with has multiple reports set up that pulls from an Access database that is password protected. When we moved everything over to a new computer, those reports now say that it cannot access the fields inside the database. It never pops up with a login screen either, like it does on the old computer. I played around with the ODBC, with no luck, couldn't get anything to work. I have also tryed relinking the database, but I keep getting connection problems. We are on a network, so her settings should have all moved with the new computer. Along with the database and the reports being on the server, so they were never moved. I am thinking it has something to do with a system file.
    I also found this document on this site, but cannot find the download it mentions, sounds similar to my problem.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/208b8fe5-681e-2b10-d2bb-b201f266d0ab
    Does anybody know how to fix this without the utility mentioned in the above link, or know where I can get the utility??
    We are using Access 2007 and Crystal Reports 7.  The database is not save as an Access 2007 database, but a regular mdb.
    Please Help!

    Post Author: ejthunder
    CA Forum: Crystal Reports
    Hello Chris,
    Crystal Reports does not store the database password with the RPT file.  This is by design (Crystal is not a database security product).  This is true of all versions of Crystal Reports.
    If your users need to see fresh data when opening the reports then they will have to log in by providing at least the password.
    You can send reports with Saved Data that won't try to hit the database, but the data won't refresh either.  To save data with the report go to the File menu and click next to Save Data with Report.  Refresh the report and then save it.  The report will now have saved data and won't try to hit the database when opened.  If the user hits the refresh button then they will get prompted to log into the database.
    I hope this helps.
    EJ

  • Database access using HTML, JSP, JavaBean, & Access

    I am trying to create an HTML page that a user logs into and can choose to query, add, delete or modify a specified database. I have created the HTML, the JSP, and access database but I can't figure out how to have 4 different JSP pages(one for each option) to get information from one JavaBean. PLEASE HELP

    http://swforum.sun.com/jive/thread.jspa?threadID=53106&tstart=0

  • Jsp and db2 problem

    Hi guys:
    I installed tomcat4, db2 run time client on one red hat 7.2. Everything works fine. My jsp can access db2 database.
    Now I am installing the same thing into another box, red hat 7.2, tomcat4 and db2 run time client.
    I can write a java code to access the db2 database, and I can access db2 table in the command line. Jsp file is running fine. But when I use the jsp code which is working in another red hat box to access the db2 database, it can not go through and it stops in "Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");" statement.
    Does any body have any idea what could be the problem?
    Regards,
    David

    hi,
    could you please send me the jsp-db2 connection code.i am really distressed.i can't find it anywhere..must i install db2 run client. i have only db2 personal edition and the rest( tomcat,jre,jsdk,etc..)
    Thx
    (while tipping my e-mail in registration,i wrote it false)
    My treu e-mail is [email protected]
    please please send me this code....

  • SQL Developer and Access with password issue

    I have Windows 7 64bits, Developer Version 2.1.1.64 and Access 2007.
    Created a MDB file added 2 tables, enabled de system tables and set a password.
    I try to configure connection but it gives a "Not Valid Password" error.
    I use on username: Admin
    And the password I'd set.
    What could be the error?
    I unset the password and it works fine.

    The password I had set was Database password and not user login so maybe there's no hope on this one, for now...

  • Syntac error in JSP and MySQL

    HI guys,
    I have been facing another problem. The codings below. Worked well with my JSP and Access database.
    Then I transfered my database to MySQL and it gives out syntax error in my SQL statement.
    CODE1:
         sql = "SELECT Week, SUM (Total_Inspected) AS ins, SUM (Total_Rejected) AS rej, SUM (Total_Accepted) AS acc, SUM (DPPM) AS dpp, SUM (Yield) AS yeel FROM Calc_Data WHERE MONTH(Inspect_Date) ="+bulann+" GROUP BY Week";
         ResultSet rs = stm.executeQuery(sql);
    CODE2:
    String query   = "SELECT ID, Model, Lot_No, Lot_Qty, Inspected_By, Reject_Desc, Area_Concerned, Location, Remark FROM OQA WHERE Customer = '"+customer+"' AND Inspect_Date =#"+tarikh+"#";
    ResultSet rs   = stmt.executeQuery(query);

    Whenever you have this type of problem, the easiest
    solution is to take the sql and try running it
    directly. For MySQL, you can either use the
    command-line client, or there are a few graphical
    clients that can handle it. Just type in the query,
    run it, and let the database itself tell you what the
    error is.
    In any case, you probably won't find much useful
    advice on a JSP forum, esp. since the problem has
    absolutely nothing to do with JSP.Indeed - I agree with this. - MOD

Maybe you are looking for

  • How to set the xmlns:urn

    Hi, can anyone tell me how i have to wirte an xsd that i can wirte a SOAP Request in which the urn is set like this: xmlns="urn:Service". I have tried to wirte a xsd but i now get two chances: 1) I just w´rite in the xsd : <xsd:annotation name="xmlns

  • HT1535 how do I add a movie not bought on iTunes to my iPad?

    how do I add a movie not bought on iTunes to my iPad?

  • IDOC_INBOUND_SINGLE

    Hi, For FM IDOC_INBOUND_SINGLE I am passing following parameters wa_idoc_ctrl-mandt = sy-mandt. wa_idoc_ctrl-mestyp  = c_bomord. wa_idoc_ctrl-idoctyp = c_bomord01. wa_idoc_ctrl-cimtyp  = c_bomord01. wa_idoc_ctrl-direct  = c_2. wa_idoc_ctrl-rcvpor  =

  • Using 'Save As' in a self contained file is dropping elements

    Hi there, I am finding with a fully self-contained Keynote file containing placed audio, movie and images, when you do a 'save as' it says there is a problem saving some elements in the file and they drop off. However if I duplicate the original file

  • Portege 3940ct OS upgrade to XPSP2-Driver Issues Disabling Lan Function

    I have canvassed all the threads on this forum (and others), and have not found a solution to my problem. But, its obvious that the main thinkers on Toshiba laptop configuration problems are here. So, if there is a solution to my problem, my best sho