HELP!!!! connecting database to JApplet

I have posted earlier and received help repainting panels on my JApplet. However, my applet doesn't retrieve data from an Access database which is also on the server in the same folder.
When I run the class as an application on my local pc it works fine but as an applet on the server it doesn't retrieve the data. It doesn't retrieve anything. It doesn't even connect to the driver properly. My code to connect is like so:
<code>
//connects to database
String dataSourceName = "http://fiji.agere.com/indrani/db1.mdb";
String dbURL = "jdbc:odbc:" + dataSourceName;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(Exception e){System.out.println("Could not connect to driver.");}
try{   
Connection con = DriverManager.getConnection(dbURL, "","");
Statement stmt = con.createStatement();
ResultSet result = stmt.executeQuery("SELECT Function FROM function_description ORDER BY Function ASC");
}catch (SQLException e){System.out.println(e.getMessage());}
</code>
I put the code in the Init method and in myactionPerformed method.

I have very limited experience in this area but I have got to make up for a dumb question asked elsewhere by me! So here goes, the datasource name looks wrong. It is in an internet format (HTTP...) rather than a simple file path and name. If this code is running on the actual server that the mdb file is on then I would think that the format would be similar to that of your application code.

Similar Messages

  • Need help connecting database in Dreamweaver MX

    I'm using Dreamweaver MX, XP Pro and IIS. I installed the
    latest version of PHP (5.2) and have mySQL and the ODBC driver
    installed.
    I set up the testing site in Dreamweaver. Yet, Dreamweaver
    cannot locate my database(s).
    I followed steps to edit the PHP.INI file to work with
    Dreamweaver correctly, yet it's not working. However, now instead
    of getting "An unidentified error has occured", I'm getting the
    vague "HTTP Error Code 500 Internal Server Error" error.
    PHP was installed manually at first but that didn't work
    right so I reinstalled it using the auto install. It should be
    accurate, only I can't see where I would enter the path to the
    database files; there is no line for that in the SQL section. But
    it's in the default directory so it should know where it is
    automatically ... ?
    Help???!!! Can someone walk me through the steps to see why
    it isn't pointing to the databases?

    Bump.

  • Help Connecting database

    Hello experts, it is possible to connect in two different company database?
    Because I created a add-on where the GL account of two company are consolidated.
    I'm now able to get all the GL account into 2 database. But I don't know how to connect them. Example in my 1st account I have a GL Account = 101010201 and it has a Credit of 100.00 Debit is 0.00 and in 2nd account I have a GL Account = 101010301 with has a balance of 0.00. In my add-on I would like to pass the Credit of the first account in 2nd account which should be put in Debit and it will have a balance of 100.00, but they are in two different database. Thus is possible? Thank you.

    I have very limited experience in this area but I have got to make up for a dumb question asked elsewhere by me! So here goes, the datasource name looks wrong. It is in an internet format (HTTP...) rather than a simple file path and name. If this code is running on the actual server that the mdb file is on then I would think that the format would be similar to that of your application code.

  • How to read a passward protected excel file with the help of database connectivity tool kit

    hi, i was reading an excel file with the help of database connectivity tool kit in labview 8.0
    i made tabels in the excel file nand made odbc connection and specified the workbbok name.
    now my problem is how to read the same file if i specife a pasword to that excel file ?

    Hi,
    Check out this thread about opening a password-protected Excel file using ActiveX. This should take care of it for you!
    Amanda Howard
    Americas Services and Support Recruiting Manager
    National Instruments

  • [Help] Regarding database connection!

    Hi , i am new to dreamweaver, I have started working on a website, the designing part is completed. I am now trying to connect database through dreamweaver to mysql. As i said I am new to this, I have created four pages, all of which are in .html format. When i  try to connect to a database, it needs me o choose from .php or dotnet.
    So, here is my question do I need to shift my work to dotnet or php? As i dont know php so i am taking dotnet
    2ndly how can I connect to a database? All schemas are defined! Which files do i need to change if i want a registration page to connect to database??
    Please Help!

    If you want to connect your website to a database, it's advisable to change the filename extension of all pages from .html to the server-side technology of your choice. Before making your choice, you might find the following article helpful: Which server-side technology should I choose?
    If you decide on .NET, you should be aware that Dreamweaver has no support for it.
    Dreamweaver has extensive support for PHP, but I wouldn't recommend using Dreamweaver's built-in server behaviors to connect to a database. They rely on outdated code, and are not recommended for use in a live website.
    If you want to set up Dreamweaver to work with PHP, instructions for doing so are in the following article: http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html.

  • Unable to connect database by DataSource in tomcat5.5 plz help to me

    hi,
    i want to connect Database through DataSource in Tomcat5.5 with mysql
    i wrote one servlet , made change in server.xml, web.xml.
    when i access it show exception
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.org.apache.tomcat.dbcp.collections)
            at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
            at java.security.AccessController.checkPermission(AccessController.java:427)
            at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
            at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)The servlet
    * DataSourceAccess.java
    * Created on August 22, 2005, 3:14 PM
    package officecom;
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.sql.*;
    * @author Paramasivam
    * @version
    public class DataSourceAccess extends HttpServlet {
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            /* TODO output your page here
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet DataSourceAccess</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Servlet DataSourceAccess at " + request.getContextPath () + "</h1>");
            out.println("</body>");
            out.println("</html>");
            out.println(" got connection ?  "+getDataConnnecion());
            out.close();
        public boolean getDataConnnecion(){
            try{
                System.out.println(" INFO : getConnection called     ");
                Context initContext = new InitialContext();
                Context envContext  = (Context)initContext.lookup("java:/comp/env");
                DataSource ds = (DataSource)envContext.lookup("mysql");
                Connection con = ds.getConnection();
                if( con != null ){
                    return true;
                }else
                    return false;
            }catch(Exception e){
                e.printStackTrace();
                return false;
        // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Returns a short description of the servlet.
        public String getServletInfo() {
            return "Short description";
        // </editor-fold>
    }Changes in server.xml
    <GlobalNamingResources>
          <Resource
          name="mysql"
          auth="Container"
          type="javax.sql.DataSource"
          password=""
          driverClassName="com.mysql.jdbc.Driver"
          maxIdle="2"
          maxWait="5000"
          username="root"
          url="jdbc:mysql://localhost:3306/sushi?autoReconnect=true"
          maxActive="4"/>
      </GlobalNamingResources>changes in web.xml
      <resource-ref>
               <description>Tomcat DBCP</description>
               <res-ref-name>mysql</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
    </resource-ref> 

    You might have more answers if you post this same question in the Sun Java Studio Enterprise forum...
    http://swforum.sun.com/jive/category.jspa?categoryID=90

  • Failed to open the connection - database vendor code 17

    I'm upgrading a VB.net Windows Forms application from 1.1 to 4.0.  In the reporting form, the list of reports you can choose are pulled from a folder where the .rpt files reside.  Once the user chooses a report and executes it, vb code populates the current database connection information and displays the report in the report viewer control.
    The following things are true:
    - Version 1.1 works on my systems and my customers systems
    - The code has not been changed, except that it now targets .Net 4.0 instead of 1.1
    - The exact same .rpt files are being used
    - Version 4.0 connects to the same database my customer is using, and I can run the reports just fine from here.
    - Version 4.0 is able to connect to the database just fine from my customers systems (using the same connection information provided to the report)
    - My customer installed this:  http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_32bit_13_0_2.zip
    The only problem is that my customer encounters this error when trying to run any report from his systems:
    Failed to open the connection.
    Details:  Database Vendor Code: 17
    Failed to open the connection.
    Orders.BOL.TaskDetail {393C9017-0ED1-4E1E-8824-E222F4B9D14C}.rpt
    Details:  Database Vendor Code: 17
    I read all of the articles I could find, and they either don't describe this exact situation, or there is insufficient information for troubleshooting this issue.  Are there steps that I've missed to make Crystal Reports for VS2010 work on my customer's systems?
    Your help is appreciated,
    Mark

    Hi Mark,
    More information required -
    - Does this happen with all reports or few?
    - What is the connection type used for the report to connect to the database (OLEDB,ODBC etc)
    - Are you changing the database at runtime?
    few things you could check
    - Check if the database is accaessible from the client machine with proper permissions / rights.
    - If its an ODBC connection check if the DSN with same name is created on the client machine.
    - Check the driver / provided used by the report to connect to the DB, verify that the same is installed on the client machine. (SQL NAtive client, SQL Server etc)
    Also take a look at below articles discussing the simillar issue.
    [CR for VS2010: Failed to Open Connection [Database Vendor Code: 17 ]|CR for VS2010: Failed to Open Connection [Database Vendor Code: 17 ]]
    [1474461 - Unknown Database Connector Error when connecting to a Dataset in a VS .NET application |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333433373334333433363331%7D.do]
    Hope this helps,
    - Bhushan.

  • Connect database using ext javascript or applescipt in indesign

    Hi,
    I need to connect oracle database using extended javascript or apple script in indesign. Can somebody help by giving any suggestion. Or is there any possibility to connect database using the two scripting methods.
    It  is really urgent.
    Thanks
    Karthik B

    ExtendScript has a Socket object prototype you can use to e.g. connect to the internet. Calling a web service would probably be more elegant than addressing the database directly. Socket is fairly low-level, though. If you need something easier, you could always try out http://extendables.org/docs/packages/http/doc/readme.html
    I seem to recall some InDesign plug-ins you could buy that allow you to connect to a database directly, but you'd have to google that yourself.

  • How to Connect Database Using Script?

    Hi all,
                    Am using Adobe InDesign CS3. Is there any way to connect database from Adobe InDesign CS3 Scripting (Javascript)? Thanks in advance.
    Regards,
    Mohan

    I don't know javascript so I can't help with that part.
    The system plug in you need is from Actual Technologies : http://www.actualtechnologies.com/ The setup for that is detailed in their instructions. You will probably want to set it up for system-wide access, not by user. I found system-wide access more reliable, fwiw.
    For Applescript I send a command through the Terminal/command line that returns the data from the query.
    Here is Applescript:
    set query to "YOUR DB QUERY"
    set results to (do shell script "echo \"" & query & "\" | iodbctest \"dsn=" & dsn & ";uid=" & uid & ";pwd=" & pwd & "\" | awk '{ if (match($0,\"SQL>\")) {k++; if (k==1) next; if (k==2) exit; } if (k==1) print; }'")
    You can probably do something similar in Javascript. You'll have to parse out the text data returned then. I think there may be plug-ins for InDesign that can directly connect to a database (?). Or some plug-ins like inData can take their data passed from a script as well.
    Chris

  • How to connect database using coding in trigger in forms

    Oracle forms6i
    Hai All
    Is there any possiblity to connect database using coding.
    For example when we open a form and we use some button and write some coding and when we execute a small will appear and we give username,connection identifier and database name.
    Is it any possible there when we create a button and in that button we write coding our database name,connectionid and user and when we exe it will internally connect database Pls tell me..
    Regards
    Srikkanth.M

    use LOGON Procedure
    PROCEDURE LOGON
      (username  VARCHAR2,
       password  VARCHAR2);
    logon('scott','tiger@orcl');Mr.Srikkanth.M if u dont close ur old questions dont expect others to answer ur question everytime......so plz remember if u think the person's answer is helpful or correct mark it accordingly
    Thanks :)
    Baig
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • Problem to connect database from Developer 6i

    I have downloaded Developer 6i from oracle.com
    before that, I have already downloaded 9i database default_home directory is c:\orant.
    while i was installing develper 6i it was installed with forms_home, c:\orant\forms.
    I was using the forms builder to design forms but while i was trying to connect to database it is saying that "Unable to Connect to Destination"
    i was using scott/tiger.
    this time i have tried scott/tiger@rkmurari...(rkmurari is SID and Database name).
    Can anybody help me in solving this problem..
    Thank you very much..

    I have a problem to connect database from developer 6i

  • Not able to connect database while creating RPD

    hi,
    while creating New RPD i am not able to connect database its Throwing error like"The Connection has failed". even though i had given Data source name as TNS entry.
    Thanks,
    Lokesh

    Hi,
    If you use OBIEE 11g, the tnsname.ora is located in this folder : {Oracle_BI1}\network\admin directory & {oracle_common}\network\admin directory (only the former is needed as that is the ORACLE_HOME).
    Do you use OBIEE 11g and have you update the tnsname.ora in this folder ?
    Hope it helps,
    Benoit

  • Need help Connecting Crystal Reports 8.5 with GBS Agency Expert 6.7.6c

    Need help Connecting Crystal Reports 8.5 with GBS Agency Expert 6.7.6c.  I need assistance on connecting these together so I can run a report.  I am not an IT person so if someone could dumb it down it would be great.
    Thanks,
    NBGHealth

    Hello,
    I assume GBS Agency Expert 6.7.6c is some sort of database or data source? If you have an ODBC driver then create or use a System DSN to the database. Then you can create a report using that DSN.
    Otherwise I suggest you contact the makers of GBS Agency Expert 6.7.6c and ask them how to connect to the database.
    Let them know CR is ANSII 92 ODBC 3 compliant.
    Thank you
    Don

  • Restrict Users To Connect Database

    Dear All,
    Actually I am working in oracle ERP R12 and I want to control users to connect database only invited nodes are connected to database through sqlnet.ora file. I set parameter in sqlnet.ora file below:
    SQLNET.AUTHENTICATION_SERVICES = (NTS)
    TCP.VALIDNODE_CHECKING = YES
    #tcp.excluded_nodes = {list of IP addresses}
    TCP.INVITED_NODES = {172.16.72.63}
    this is working in database but in erp environment this is not working any one please help me!!!
    Regards,
    Muhammad Zubair
    DBA Warid Telecom Pakistan
    00923244509956

    Can you elaborate a bit on "not working"? What, exactly, is the behavior you're seeing? What is the behavior you expect? Are you getting errors? If so, what errors?
    In the "ERP environment", are users connecting via a client/ server application? Or via a three-tier application? Assuming a three-tier application, are you trying to invite the nodes of the application servers? Or of the end clients (or, potentially, the web servers)?
    Justin

  • IView Connection database

    Hi,
    I am new and I have a problem trying to connect a Oracle (even a MySql) database.
    Here is th process I have used:
         - <u>Creating new System</u>
    But I have problem about Distributed Query Engine (DQE).
    I don't know what to put in these parameters : user /password.
         - <u>Creating a System Alias</u>
         - <u>Making Connections tests</u>
    Nothing happen with "Connection Test for Connectors"
    Error appears with "Connection Test Throught DQE"
    So I think my problem comes from DQE parameter but I am not sure that there is no other problem:
    Is someone knom all task to do to connect database ?
    (in term of <b>connector</b>, <b>system</b>, <b>alias</b>, <b>DQE</b> .....)
    Can someone help me ?
    Thanks,
    Fabien

    Hi Vaishali,
    Thanks for your response.
    I have done what you said except the last task.
    In fact, in user management, I put : user, admin.
    But In  "User Administration", I can't make any user mapping.
    That what I explain, to Gesche :
    When I try to make a user mapping, I get a exception:
    Portal Runtime Error
    <i>An exception occurred while processing a request for :
    iView : pcd:portal_content/administrator/super_admin/super_admin_role/com.sap.portal.user_administration/com.sap.portal.user_mapping/com.sap.portal.userMappingAdmin/com.sap.portal.userMappingAdmin
    Component Name : com.sap.portal.usermanagement.admin.UserMappingAdmin
    The exception was logged. Inform your system administrator..
    Exception id: 10:57_10/06/05_0008_1355550
    See the details for the exception ID in the log file</i>
    I am going to see log file to get explaination ...
    Just another question about the driver you enter in Connector parameter :
    Is there something else to do (for example, declare datasource for it in visual administrator) or declare it here is enough ?
    Thanks a lot,
    Fabien

Maybe you are looking for

  • Blue line running through screen (T400 1440 x 900)

    Hey guys, So  my monitor has this blue line running straight through my monitor vertically. When I first got it, if I tapped my monitor on the side a bit, it would go away but then the line was permanent! I thought my screen was busted and started lo

  • How do I get OS Mountain Lion on to my mac running Lion?

    I have a recently purcased iMac running Lion.  I have downloaded the Messages beta.  But, I am wondering this: When Mountain Lion is released, am I eligible for a free upgrade? Is it something I can download or do I have to takeit to an Apple retail

  • Top Link error 17002 The Network Adapter could not establish the connection

    I have installed an application developped in an another environnement. I have created the database schema in my own database. I have created a database connection to this schema. I have reconciled the schema using this connection (so the database an

  • Better to load videos with AS or place videos on frames?

    I don't have the AS3 knowledge required to quickly create a custom menu  system to play several videos in an FLVPlayback component or a Netstream  object, so I'm relegated to using some of the canned ones, or a 'menu  maker'. Trouble is, most,or all

  • Archive data

    Hi, I am new to the Oracle database. And I need to archive data that is older than 60 days and delete the data from the tables. The tables have refertential integrity constraints. The archive data need to be resored back to the tables when necessary.