An error occured when connecting java with Ms Access

Hello Everybody
I am a new developer in java and want to connect java with Microsoft Access
i am using JCreator LE
My code is to insert 3 records for 3 members and then save them in DB and retrieve the information
Here is the code
import java.sql.*;
public class Project3 {
    public static void main(String[] args) {
         try {
              System.out.println("Beginning Connection");
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String accessFileName = "Information";
            String connURL = "jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb);DBQ="+accessFileName+".mdb;PWD=";
            Connection con = DriverManager.getConnection( connURL ,"","");
            Statement stmt = con.createStatement();
            System.out.println("Connection done successfully");
            stmt.execute("Create table Member(Name String,ID Integer)");
            stmt.execute("insert into Member values ('Joe','1234')");
            stmt.execute(" select * from Member");
            ResultSet rs=stmt.getResultSet();
            if (rs != null)
                 while (rs.next()){
                      System.out.println("Name: "+rs.getString("Name")+ "ID: " + rs.getString("ID"));
            stmt.close();
            con.close();
            catch (Exception e) {
            System.out.println("An error Occurred in Connecting with the DB " );
}and the error is
Beginning Connection
Connection done successfully
An error Occurred in Connecting with the DB
it didn't insert information in the DB

Well, thank u i have traced the error and fx it
but
how to modify the code and keep the user entering 3 values and search for the entered values??
Here is the correct code
import java.sql.*;
public class Project3 {
    public static void main(String[] args) {
         try {
              System.out.println("Beginning Connection");
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String accessFileName = "jdbc:odbc:Project";
            String connURL = "jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb);DBQ="+accessFileName+".mdb;PWD=";
            Connection con = DriverManager.getConnection( accessFileName);
            Statement stmt = con.createStatement();
            System.out.println("Connection done successfully");
            stmt.execute("Create table Member(Name String,ID Integer)");
            stmt.execute("insert into Member values ('Joe','1234')");
            stmt.execute(" select * from Member");
            ResultSet rs=stmt.getResultSet();
            if (rs != null)
                 while (rs.next()){
                      System.out.println("Name: "+rs.getString("Name")+ "ID: " + rs.getString("ID"));
            stmt.close();
            con.close();
            catch (Exception err) {err.printStackTrace();}
}

Similar Messages

  • An error occurred when connecting to the accounting system ID3DEV310

    Hi Friends,
    We are Implementing collaboration project 4.5 and want to link with project system in ECC 6.0. Both these are in the different servers.
    I have done the configuration on both the servers and also maintain the RFC (ID3DEV310) in Object Links.
    When I create or open the existing project I get the following error: "An error occurred when connecting to the accounting system ID3DEV310"
    Costing Variant taken is PS01 (Project Planning).
    Your reply would be highly appreciated.
    Aryan

    Hi Deepak,
    I have assigned the RFC destination and web server to the object type: "0WBSELEMENT" only
    Also the same has been done for define Object links for accounting integration "0FIN_INT_ERP_PS"
    I have entered these specific to PS objects only.
    Aryan

  • Error occurred when processing Java Programs in VM Container

    Hi Gurus,
    We are trying for an extraction from 0CRM_SALES_ORDER_I in CRM 5.0. This is frequently getting terminated and we are getting an error message saying that “Error occurred when processing Java Programs in VM Container”. We have checked in SM52 and the VM container is active.
    We have tried in two systems, CRQ and CRP. In CRQ, we are not facing any problem but with CRP we are facing the the above said error. The EXIT_SAPLRSAP_001 is the FM that is used to fetch Transactional Data. This FM is NOT called in CRP System for this extractor. Can anyone guide us in this issue?

    Savan - did you resolve your error? We are getting the same error, and would like to know how you solved it.
    Thanks,
    Erik

  • Error occured when connect to MySql Databse in Dreamweaver

    Hello! I met a problem when connect to Mysql Databse in
    Dreamweaver
    Details:
    My Php Environment: Php 5.2.2+ MySql 5.0.4 + IIS 6.0 + DW IDE
    + WinXP SP2,
    All necessary sevice started(Actually I have never stopped
    any Windows service).
    Php installed (IIS + CGI) and tested successfully in DW
    MySql Installtion(Typical Install with extensions ) and
    configuration are both OK.
    Configuration Details:
    For configuration type, select Detailed Configuration.
    For server type, select Developer Machine
    For database usage, select Non-Transactional Database Only.
    For the number of concurrent connections, select Decision
    Support(DSS)/OLAP.
    For networking options, accept the default settings.
    For the default character set, accept the default setting.
    For the Windows options, select both options – Install
    As Windows Service, and Include Bin Directory in Windows Path.
    For security options, enter a root password and confirmed.
    And then I Created a database "mydb" with 3 tables inside by
    "MySql Command Line Client",
    ...... (Approach Obmit here)
    Open "MySql Command Line Client":
    Type >mysql Show Database mydb;
    Show a list with 3 tables(Created Successfully)
    Then In DW,
    Open my Php webpage,
    Then from Database Panel>MySql Connection,
    Connect Name:myconn
    Mysql Server:localhost
    Username:root (Right)
    Password:111111(Right)
    Database:mydb
    Click "OK", but when DW tried to connect to MySql database,
    then DW popuped an alert dialog says "HTTP Error Code 502 Bad
    Gateway",
    I don't know what this mean and how to solve this problem,
    hope any PHP and DW expert can help me, thank you very much.

    Phoenix Wang wrote:
    > Click "OK", but when DW try to connect to MySql
    database, then popup an alert
    > dialog says "HTTP Error Code 502 Bad Gateway",
    > I don't know what this mean and how to solve this
    problem, hope any PHP and DW
    > expert can help me, thank you very much.
    How have you set up the Testing server in your site
    definition?
    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 occurred when processing Java programs (CRM ORDER READ is called)

    Hi,
      We are facing a problem while running a batch job.Its a batch job which reads order data from crm system by using crm order read and generates fur files on application server.
    But the problem is,  after executing or generating lets say 10000 records in file the batch job is automatically closed.
    When we tried to analyse it from SM37 we got the error message saying,
      " An error occurred while executing a Java program in the VM container"
    So what could be the reason of this problem.And what is the solution.
    Regards
    PG

    This is the error we get when we read Pricing condition or Variant Config from the ORDER.
    I think you are not  initalizing the order after you have the read the data.Pass the guid to ti_guis_to_init.
       call function 'CRM_ORDER_INITIALIZE'
          exporting
            it_guids_to_init = <>
          exceptions
            error_occurred   = 1
            others           = 2.
    This may solve the problem.
    Edited by: Chandra on Jan 30, 2009 1:30 PM

  • Error occured when sending mail with PDF attachment

    Dear Experts
    When i trigger email through SMTP server with PDF attachment using application server 10g , i got following error :
    REP-50159: Executed successfully but there were some errors when distribute the output
    i am using web.show_document utility
    str1:='http://erp.ruchi.com:7777/reports/rwservlet?destype=mail'||'&desname='||c1rec.hist_email||'&from=[email protected]'||'&subject=Your Payslip for Month '||to_char(c1rec.tran_month,'Mon-YYYY')||'&desformat=PDF&server=rep_erp_bi&report=/asdeploy/webutil/pay/reports/payslip.rdf&userid=qwqwqw/aasasas@DIAMOND'||'&COMPANY='||:parameter.para_comp_code||'&LOCATION='||:parameter.para_loc_code||'&MONTH='||to_char(:sdate,'MM/YYYY')||'&ECODE='||c1rec.tran_ecode;
    WEB.SHOW_DOCUMENT(str1,'_SELF');
    previously i had successfully using this utility but now i am facing above error
    Pl suggest
    regards
    shailesh

    Dear Experts
    I already configured application server configuration file with specifying SMTP mail server IP in pluginParam parameter
    <pluginParam name="mailServer">202.157.161.76</pluginParam>
    <property name="enableSSL" value="no"/>
    <property name="mailUserName" value="%[email protected]%"/>
    <property name="mailPassword" value="%soyacl#123%"/>
    what is the issue
    Pl clarify
    Please reply it's urgent

  • Error occurs when installing Java Web Start.

    Before installing, I have installed j2sdk1.5.0 and j2ee1.4,all environment variable have been set correctly, and the javac and java commands can run correctly.
    But when i install Java WS,It says it can't find the jre,ask me to install jre1.3.1,I have already installed two jre,so i don't want another.
    Why? How can i resolve it?

    Where are you looking?
    For 1.5.0_x on Windows it located in your Control Panel. Open the Java Control and then click the Settings button. Finally click the View Applications... button.
    Or you can simply type javaws at a command prompt or from the Start->Run... Dialog

  • Error message when  trying to connect Classic 120GB to iTunes    An internal error occurred during: "FindSonarTrackJob". java.lang.NullPointerException

    When trying to connect to iTunes I get this message  
    An internal error occurred during: "FindSonarTrackJob".
    java.lang.NullPointerException

    I too am having this problem and have had, for about a week now.
    I've found that by logging off itunes (if I can), closing it down, and then restarting it, sometimes allows it to work for one transaction (say downloading an updated app). After that it's back to the same error.
    Really annoying.

  • "An error occurred when communicating with the server. Check connectivity with your administrator to determine whether further action is necessary", then attempt to approve TimeSheet.

    Kind day, colleague.
    It was required to organize a statement chain for TimeSheet of employees, as we realized. Everything is good, but at linear managers in PSW opportunity to execute Approve when viewing TimeSheet of the employee remained, and in attempt to approve TimeSheet there
    is a mistake.
    500 Internal Server Error
    "An error occurred when communicating with the server.  Check connectivity with your administrator to determine whether further action is necessary. "
    Accept, is carried out as it is necessary.
    It is a bug or we not correctly realized approval chain?

     issue is  related to the user booking time against a task that was past the finish/end date listed in the Project Schedule.
    To resolve the user needs to submit their time on a valid task that is still within the current reporting timeframe, or have the Project Manager
    update the task in questions so that the finish/end dates are at or beyond the submission period and then republish the project. After that, the user should be able to go in and submit their timesheet with success.
    http://patrickdrews.com/2012/09/project-server-2010-timesheet-submission-produces-an-error-occurred-while-communicating-with-the-server/
    kirtesh

  • Failed to execute with the error Error occurred when starting the parser: t

    Dear All
    I am getting this error
    ""A database error occurred. The database error text is: The MDX query SELECT  { [DASKA1EDEL2DMLXTQ62S595QV].[DB7BP4A8AMQTUD3DPEEPS4J87] }  ON COLUMNS , NON EMPTY CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( [0CALMONTH].[LEVEL01].MEMBERS, [DASKFZ1TRFOLNTG78G0HH2B87].MEMBERS ), [0MATERIAL].[LEVEL01].MEMBERS ), [0PLANT].[LEVEL01].MEMBERS ), [0COMP_CODE].[LEVEL01].MEMBERS ), [0ACTDELDATE].[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_NAME, MEMBER_CAPTION ON ROWS FROM [0IC_C03/ZMATSTOCK]  failed to execute with the error Error occurred when starting the parser: timeout during allocate / CPIC-CALL: 'ThSAPCMRCV'. (WIS 10901)""
    I already went to similar kind of error solution in forum,but this error is coming for one web I query,all other reports are working fine.
    I already implemented note 1032461

    Hi,
    Under normal circumstances it should be enough to restart the connection service.
    As far as we know there is no formal solution to this problem from SAP yet but restarting the connection service is much less of an interuption compared to restarting the the SIA.
    Re-starting the connection service should resolve this issue. since, Connection service is only related to DeskI and Rich Client re-statrng wonu2019t impact other business objects components including java report panel.
    All the Best,
    Madhu....

  • Communication error occurred when trying to connect to server

    I am using RAS SDK to connect to the BO server. While running the report for performing opendocument, it's giving the following error.
    Caused by: com.crystaldecisions.enterprise.ocaframework.OCAFrameworkException$CommunicationError: Communication error occurred when trying to connect to server PUNDL10492.WebIntelligenceProcessingServer
    cause:com.crystaldecisions.thirdparty.org.omg.CORBA.BAD_PARAM:   minor code: 0x0  completed: No
    detail:Communication error occurred when trying to connect to server PUNDL10492.WebIntelligenceProcessingServer
    The exception originally thrown was com.crystaldecisions.thirdparty.org.omg.CORBA.BAD_PARAM:   minor code: 0x0  completed: No
         at com.crystaldecisions.enterprise.ocaframework.e.do(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.o.try(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.p.a(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.getManagedService(Unknown Source)
         at com.businessobjects.rebean.wi.occa.OccaConnection$CDZStubHelper.getService(OccaConnection.java:270)
         at com.crystaldecisions.enterprise.ocaframework.e.do(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.o.try(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.p.a(Unknown Source)
         at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.getManagedService(Unknown Source)
         at com.businessobjects.rebean.wi.occa.OccaConnection.doConnect(OccaConnection.java:110)
         ... 38 more
    Caused by: com.crystaldecisions.thirdparty.org.omg.CORBA.BAD_PARAM:   minor code: 0x0  completed: No
         at com.crystaldecisions.enterprise.ocaframework.idl.OCA.OCAcdz.WICDZServer.CDZHomeHelper.narrow(CDZHomeHelper.java:109)
         at com.businessobjects.rebean.wi.occa.OccaConnection$HomeStubHelper.narrow(OccaConnection.java:338)
         ... 52 more
    Please help me to solve the issue

    Using BO SDK i am connecting to the BO Report Server, to fetch the BO Reports, But while trying to run the report, i am getting the following error.
    Caused by: com.crystaldecisions.enterprise.ocaframework.OCAFrameworkException$CommunicationError: Communication error occurred when trying to connect to server PUNDL10492.WebIntelligenceProcessingServer
    cause:com.crystaldecisions.thirdparty.org.omg.CORBA.BAD_PARAM: minor code: 0x0 completed: No
    detail:Communication error occurred when trying to connect to server PUNDL10492.WebIntelligenceProcessingServer
    The exception originally thrown was com.crystaldecisions.thirdparty.org.omg.CORBA.BAD_PARAM: minor code: 0x0 completed: No
    at com.crystaldecisions.enterprise.ocaframework.e.do(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.o.try(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.p.a(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.getManagedService(Unknown Source)
    at com.businessobjects.rebean.wi.occa.OccaConnection$CDZStubHelper.getService(OccaConnection.java:270)
    at com.crystaldecisions.enterprise.ocaframework.e.do(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.o.try(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.p.a(Unknown Source)
    at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.getManagedService(Unknown Source)
    at com.businessobjects.rebean.wi.occa.OccaConnection.doConnect(OccaConnection.java:110)
    ... 38 more
    Caused by: com.crystaldecisions.thirdparty.org.omg.CORBA.BAD_PARAM: minor code: 0x0 completed: No
    at com.crystaldecisions.enterprise.ocaframework.idl.OCA.OCAcdz.WICDZServer.CDZHomeHelper.narrow(CDZHomeHelper.java:109)
    at com.businessobjects.rebean.wi.occa.OccaConnection$HomeStubHelper.narrow(OccaConnection.java:338)
    ... 52 more
    Please someone help me with the following issue.

  • An unknown error occurred when Dreamweaver tried to connect to this Contrib

    Hello all,
    I just started having a Dreamweaver problem that's perplexing me...
    I have 2 machines, a G4 and a G5 both running Dreamweaver ( I have MX2004 and 8 on both machines, this problem effects both versions on the G5 only).
    Everything was humming along just fine until the other day when suddenly I was receiving error messages on my G5 stating
    "An unknown error occurred when Dreamweaver tried to connect to this Contribute site".
    Then my local folder containing the website that I was working on would go gray (in Dreamweaver) and lose it's folder icon. It would still look like it was there, just no icon. When I would click on the drop down triangle it would state, " The local root folder, (and the folders name), does not exist. Please select a new local folder by clicking the Manage Sites button".
    I then ran a couple of tests on the G4 and it connected fine, I was able to edit, upload/download, everything as usual. I then attempted to connect to the site with Transmit on the G5...no problem.
    In the site definition I remembered that it may be set up to work with Contribute sites, but this was not the case, the box was unchecked.
    I then had the idea to export the site key from the G4 and grab it onto the G5 and import it into Dreamweaver...I did this AND IT WORKED! Once...after that back to the 2 usual errors.
    I found a work around for now...do my editing/site building in Dreamweaver, and upload with Transmit...this works fine...I've found that the errors only happen AFTER I've connected with the site(s). I've tried this with the other sites I maintain and it was the exact same thing.
    Are there any similar experiences out there? This has really got me stumped... can't imagine what it is.
    Any help would be greatly appreciated.
    thanks
    G5 Dual 2, G4 Dual 1.4 GHZ, iBook Graphite SE   Mac OS X (10.4.4)  

    my firewall is off, everything worked up until a couple days ago when it randomly stopped working

  • CRS 5 Backups fail with this error: Unknown error occured while connecting to the host

    Dear All,
    We have backup issue with  UCCX 5.0(2)SR03_Build317, while trying to take  backup giving following error "Unknown error occurred while connecting to the host".
    I have found the solution in the Cisco and tried all the suggestion, still not working and same error observed. Due to backup issue we unable to do any changes on the CRS, when we try to create new agents, those agents are not reflecting in the CRS.
    Also I have observed bellow error , when try to re-sync the JTAPI,
    Error while handling the input   request.
    Top of Form
    Config Changes are not allowed during 'Backup' operation, which   was started by 'Scheduler' at 'Fri Jun 08 18:00:03 GMT+08:00 2012 '. Please   try again after 'Backup' is complete.
    Bottom of Form
    http://www.cisco.com/en/US/products/sw/custcosw/ps1846/products_tech_note09186a00809a752c.shtml
    Solution
    Complete these steps in order to resolve this issue:
    •1.      Access the UCCX server and navigate to Start > Run, and type CET.
    •2.      When the warning message appears, click NO.
    •3.      Choose com.cisco.crs.cluster.config.ArchiveAdminConfig.
    •4.      On the right side, double-click the record ID.
    •5.      Click the com.cisco.crs.cluster.config.ArchiveAdminConfig tab, and clear the password under Backup Storage.
    •6.      Click Apply.
    •7.      Navigate to Appadmin > Tools > Backup and Restore.
    •8.      Under Backup Storage Location, type the new password, and click Update.
    After you complete these steps, you can run the backup. If the backup fails, restart the server, and try the backup again. If the backup still fails, you can navigate to CET, clear all the fields, and then type the new information for the storage location.
    Please help me with your suggestions.
    Thanks & Regards,
    Naveen .S

    Please any one help me on this issue..

  • Data Quality vendor-specific error: An error occurred when calling function 'sdq_init_connector ()' in connector ": "(-8) Exception!." Detailed error message: Exception thrown by Java: java.lang.UnsatisfiedLinkError: nio (Not found in com.ibm.oti.vm.boots

    When attempting to create a new Account in siebel integrated with OEDQ the following error occurs.
    ERROR
    Data Quality vendor-specific error: An error occurred when calling function 'sdq_init_connector ()' in connector ": "(-8) Exception!." Detailed error message: Exception thrown by Java: java.lang.UnsatisfiedLinkError: nio (Not found in com.ibm.oti.vm.bootstrap.library.path)(SBL-APS-00118)
    STEPS
    The issue can be reproduced at will with the following steps:
    1) from EDQ director we have imported the EDQ_CDS,EDQ-REFERENCE DATA & EDQ_HISTORICAl DATA packages sucessfully.
    2) Created dnd.param file in SIebel server SDQCOnnector folder.
    3) Copied the libdnd.so file to siebsrvr lib directory(32 bit)
    3) In dnd.param file we have mentioned the javalib file and instllation directory path(<Siebsrvr roo>/dnd/install)
    4) Unzipped the EDQ-Siebel Connector files in dnd/install folder
    5) Copied the dnd.properties file in dnd/install directory and modified it accordingly to point to installed EDQ instance.
    6) Configured the Siebel components for EDQ integration.
    7) Realtime EDQ jobs are running.
    8) Create a new Account
    Env details are
    On : 8.2.2.14 [IP2014] version, Client Functionality
    EDQ 11.1.1.7.4
    IBM JDK 1.7 32 bit
    Using Open UI
    Any Champ have faced this issue and overcame it please let me know the resolution steps. your help is
    Regards
    Monoj Dey
    9007554589

    Hi Monoj,
    A few questions:
    - What OS is Siebel running on?
    - What version of the Siebel connector are you using?
    - Which libdnd.so file are you using?
    - What's the contents of your dnd.parms file?
    thanks,
    Nick

  • ???  I just installed Lightroom 5 from Amazon for my Mac with 10.10.1 software.  When I open it I get: "An error occurred when attempting to change modules".  It won't import photos and has no side panels under Library.  What should I do?

    I just installed Lightroom 5 from Amazon for my Mac with 10.10.1 software.  When I open it I get: "An error occurred when attempting to change modules".  It won't import photos and has no side panels under Library.  What should I do?

    I Nearly bought from Amazon too but I found a thread from Adobe stating that the only recognized outlet for lightoom is themselves and other outlets serial numbers will not be guaranteed.
    THat at was sufficient for me to buy direct from Adobe, hope you get it sorted.

Maybe you are looking for

  • Errors encountered during perfromance testing

    While doing some stress testing on our WLS server we kept seeing the following errors: 1) NullPointerException on NTSocketMuxer, error log follows: Tue Feb 22 05:08:28 EST 2000:<E> <NTSockMux> failure in processSockets() loop: GetData: fd=16764 numBy

  • Java Bea CallableStatement

    What i use: Oracle 8.1.7.0.0 jsp i have a Stored procedure that has an IN OUT number in the jsp i do the following ... //declare variables yada yada cs = conn.prepareCall("{call MARKET_COPY(?)}"); cs.setInt(1, 12); cs.registerOutParameter(1, java.sql

  • Newbie - Basic Problem - Can anyone help?

    I can't seem to get video transitions to work on either .jpg's or .DV's - the effects are showing in gray. I'm sure it's something very basic. If anyone could offer a suggestion, I would really appreciate it. Thanks

  • VLC still running in the background (~200% CPU)

    Hello, I noticed that my laptop was getting really hot so I checked the processes running. I found out that a VLC process was still running and using weirdly about 200% of the CPU... I couldn't kill it and had to restart. Any clue about how this coul

  • PST Capture error when trying to import .PST files

    I am currently migrating mailboxes from Exchange 2010 to Exchange 2013 on prem.  I have installed PST Capture 2.0 and 64-bit Outlook 2013 on a Windows 2008 R2 machine and have installed the PST Capture 2.0 agent on a workstation that has some .pst fi