Java + MS Access

I'm have a database with two fields Date(Date/Time) and amount(text) and I want to retrieve the Date With the following code.
Connection connectionObject;
connectionObject = DriverManager.getConnection(URL,username,password);
StatementObject = connectionObject.createStatement();
String sqlQuery = "SELECT [Date] FROM Account;";
ResultSet statementResult = statementObject.executeQuery(sqlQuery);
while(statementResult.next())
DateFormat df = DateFormat.getDateInstance();
java.sql.Date d = statementResult.getDate(1);
String formattedDate = df.format(d);
but I get this error:
Problem with nullsent to jdbc :dbc:shop.
Problem is : [Microsoft][ODBC Microsoft Access Driver]Invalid character value for cast specification on column number 1 (Date)
Can anyone tell me what the problem is and how to fix it.
Thx

Thanks,
How come it works with an INSERT statement?Blind luck. If you don't use it then this oddity goes away.

Similar Messages

  • Not able to start the Sun Java System Access Manager 7 Console

    Hi All,
    I have successfully installed the Sun Java System Portal Server 7 on RHEL 4.0.The problem I am facing is not able to start the Sun Java System Access Manager 7 Console while accessing the URL: http://fqdn:8080/amconsole
    As soon as I try to access this URL it gives me following Excepiton:::::::
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    com.iplanet.jato.NavigationException: Exception encountered during forward
    Root cause = [java.lang.NullPointerException]
         com.iplanet.jato.view.ViewBeanBase.forward(ViewBeanBase.java:386)
         com.iplanet.jato.view.ViewBeanBase.forwardTo(ViewBeanBase.java:267)
         com.iplanet.am.console.base.ConsoleServletBase.onUncaughtException(ConsoleServletBase.java:338)
         com.iplanet.jato.ApplicationServletBase.fireUncaughtException(ApplicationServletBase.java:1023)
         com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.java:469)
         com.iplanet.jato.ApplicationServletBase.doPost(ApplicationServletBase.java:324)
         com.iplanet.jato.ApplicationServletBase.doGet(ApplicationServletBase.java:294)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    If anyone have any idea about the cause of this error,please let me know.All suggestions are welcome .
    Thanx and Regards,
    Chirag.

    Hi All,
    I am having exactly the same problem with the same stack trace. Has anybody have an idea how to fix this?
    I have downloaded the Java Identity Management Suite.(java_es-5-identsuite-ga-windows-x86.zip) The first time installation was fine and I was able to bring the Access Manager console. I was able to create users groups etc.
    However, when I uninstalled and installed it again, I got exactly the same error described in the thread. Running "amserver start" and "amserver restart" did not help. I did the installation one more time
    but again I got the same error.
    Thanks for the help.
    celikkan

  • Integrating WebSphere Portal Server with Sun Java System Access Manager

    Hi All,
    Is it possible to Integrate WebSphere Portal Server with Sun java System Access Manager?. If so plz send me any doc or web site link for the same.
    Thanks in Advance
    Rgds,
    Lessly J

    Rushi-Reliance wrote:
    Kindly let us know how to proceed further as we are waiiting some reply from your team.As I already advised in your previous posting (http://forums.sun.com/thread.jspa?threadID=5359095), you are best off re-installing solaris from scratch and installing Communication Suite 6 update 1 if you cannot get Access Manager 7.1 configured.
    Regards
    Shane.

  • Linking Java to Access Database tables

    Hello,
    I need use JCreator to link Java to Access Database tables.
    Could any one tell me what kind of drivers I need use?
    Also, where could I find the examples of linking Java to Access Database tables?
    Thank you,
    Daniel

    Thanks.
    I have read the tutorial and downloaded the sample code from the web http://java.sun.com/docs/books/tutorial/jdbc/
    In the CreateCoffee.java programming, I made the following changes:
         //     String url = "jdbc:mySubprotocol:myDataSource";
              String url = "jdbc:odbc:DB1";
    DB1 is an Access Database file located in the same folder as CreateCoffee.java.
    //Class.forName("myDriver.ClassName");
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Every time when I run the CreateCoffee.java programming, it shows the following running error:
    SQLException:[Microsoft][ODBC Driver Manager]
    Data source name not found and no default driver specified.
    Could any one have any suggestions for solving the above problem?
    Thank you,
    Daniel

  • JAVA NATIVE ACCESS

    hi
    It would be helpfull for me if anybody give good reference/ link related JAVA NATIVE ACCESS
    i have tried through google and sun search but most of all are java native Interface...
    so please
    thanks in advance

    Hello guys,
    I have a problem in JNA to create interface method because i must search functions in DLL which have many structures as argument. So i find JNA is difficult but less than JNI.
    I would like to give you my specification file and traduce this fonction in the interface of JNA. Please help me !!!!
    Here is these C functions :
    typedef disco_err (WINAPIV* win_disco_init)(disco_init_conf_t* conf);
    typedef enum {
    DISCO_ERR_NONE = 0, //!< No error
    DISCO_ERR_IO = -1, //!< IO error
    DISCO_ERR_DB = -2, //!< Database error
    DISCO_ERR_MEM = -3, //!< Memory allocation error
    DISCO_ERR_PAR = -4, //!< Invalid parameters
    DISCO_ERR_ND = -5, //!< Max number of opened descriptors is
    reached
    DISCO_ERR_NS = -6, //!< Service not supported
    DISCO_ERR_ID = -7, //!< Bad id
    DISCO_ERR_FF = -8, //!< Bad file format
    DISCO_ERR_EOF = -9, //!< End of file
    DISCO_ERR_NOE = -10, //!< No such entity
    DISCO_ERR_INT = -11, //!< Database build interrupted
    DISCO_ERR_ACCESS = -12, //!< Access denied
    DISCO_ERR_EMPTY = -13, //!< Empty information
    DISCO_ERR_NO_MORE_RESPONDING_IPOD = -14, //!<no more iPod
    DISCO_ERR_OTHER = -30, //!< Other
    }disco_err;
    typedef struct {
    disco_uart_iap_init iap_via_uart;//! Unused
    int priority; //!< Priority level of Disco threads
    disco_spec_strs_t strs; //!< Special strings configuration
    }disco_init_conf_t;
    typedef struct {
    const char* empty; //!< String for undefined lists elements
    const char* root; //!< Name for virtual 'Root' directories
    }disco_spec_strs_t;
    So it's a real crazy mapping between C and Java. It's too dificult for me. i hope there will be a professional of mapping ? Give me the solution please because i have 20 days to design the modul of my java application.
    thanks in advance,
    Nicolas.

  • Can ABAP program and a Java apps access the same DB table?

    If an ABAP program and a Java apps access the same DB table, how does the Enqueue services from ABAP and Java communicate with each other to ensure locking consistency (if they even communicate with each otehr at all)?
    Or there wont be such situation because there are separate schema for ABAP stack and Java stack?
    Your help is greatly appreciated.

    Hello!
    A while ago I was a subject to criticism too for not granting points to helpfull answers. I appeared to be ungratefull, but I'm actually not (I guess the same goes for Vincent). I absolutely agree that good people who provide helpfull answers deserve (at least) points, but I didn't quite get the whole idea with points untill I was explicitly warned. I took some time to correct this and I granted points for all my past questions, generously, with "interest rates" for waiting.
    My point is:
    The pointing system is good, but unintuitive and not documented. I suggested this at that time, and I see that nothing has changed since. I see also that I'm not the only one who has experienced missunderstandings.
    I repeat the message to SDN people: Please provide some info on pointing system! A few sentences behind a "What's this?" link would do. It's not such a hard work.
    Thanks!
    Kind regards,
    Igor Barbaric

  • Java.exe Access Violation Error(URGENT)

    Hi all,
    I have created a application for my company. This application requires a user to login into the site by giving his userid/pwd. Once the person logs into the site, there is this error "Java.exe Access Violation Error" which pops up and terminates the Web Server.
    My Login page is a HTML page which inturns calls a Jsp which authenticates the user.Once the authentication is completed, the user id is put into the session so i can check for the existence of user session on each subsequent page. After the user successfully logs in, the error pops up.
    Please get back to me incase u have ever encountered this error and what might be the solution.
    I am using Tomcat Webserver 3.2.3, Sql Server 7.0 as the Database Server, JDK1.3 .
    Regards,
    Yatin

    As far as i remember i faced this problem when the memory of my pc was broken. So it may not be a problem of java or html code.

  • Can java software access media on the phone?

    Hello
    Can homemade java software access mp3-files, images, sms, phone book etc. on a mobile phone?

    FileConnection API, PIM API,...
    have you read some docs on J2ME ?

  • Sun Java System Access Manager 7.1 config. failed during installation

    {color:#0000ff}Hi,
    I have installed sun java communication suite 5 on a single host on sun solaris 10.
    I have installed required packages and it works fine.
    But as per organization need, I have to change domain name.
    So i have uninstalled everything and tried to install again with new domain name.
    I have made proper entries in hosts file and resolve.conf file.
    But duing the first phase of installation only , i failed in configuring access manager 7.1
    I have also cerate same scenario in my test environment, but everytime i face the same error.
    and sun java access manager 7.1 fails in first stage of installation only.
    So would like to know the proper installation procedure while i change the domain name on same hardware...
    I have checked both installation logs & summary logs.
    But no error, no failed , no severe.
    Attached is the summary of installation logs.
    Summary Logs :
    Installation Summary Report
    Install Summary
    Sun Java(TM) Communications Suite : Installed
    Sun Java(TM) System Web Server 7.0 : Installed, Configured
    Java DB : Installed, Configure After Install
    Sun Java(TM) System Message Queue 3.7 UR1 : Installed
    Sun Java(TM) System Monitoring Console 1.0 : Installed, Configure After Install
    Sun Java(TM) System Directory Preparation Tool : Installed
    Sun Java(TM) System Directory Server Enterprise Edition 6.0 : Installed, Configured
    Sun Java(TM) System Access Manager 7.1 : Installed, Configuration Failed
    Sun Java(TM) System Messaging Server 6.3 : Installed, Configure After Install
    Sun Java(TM) System Communications Express 6 : Installed, Configure After Install
    Communication Services Delegated Administrator : Installed, Configure After Install
    Configuration Data
    Sun Java(TM) System Web Server 7.0 :
    Web Server Instance installation Directory : /var/opt/SUNWwbsvr7
    Web Server installation Directory : /opt
    Web Server Administration Server Host : RADAGWMSG221.myreliancemail.com
    Web Server Admin Server Mode : true
    Web Server only CLI installation : false
    Sun Java(TM) System Directory Preparation Tool :
    Directory Preparation Tool Installation Directory : /opt/SUNWcomds
    Sun Java(TM) System Directory Server Enterprise Edition 6.0 :
    Directory Server Installation Directory : /opt/SUNWdsee
    Sun Java(TM) System Access Manager 7.1 :
    Access Manager Installation Directory : /opt
    Access Manager Protocol : http
    Access Manager Port : 80
    LDAP User ID : amldapuser
    Administrator User ID : amAdmin
    Web Container : WebServer
    Access Manager Web Server Host Name : RADAGWMSG221.myreliancemail.com
    Access Manager Web Server Instance Directory : /var/opt/SUNWwbsvr7/https-RADAGWMSG221.myreliancemail.com
    Access Manager Web Server Port : 80
    Access Manager Console Host (for Existing console) : RADAGWMSG221.myreliancemail.com
    Access Manager Console Deploy URI : amconsole
    Access Manager Password Deploy URI : ampassword
    Access Manager Host : RADAGWMSG221.myreliancemail.com
    Access Manager Console Port(for Existing console) : 80
    Access Manager Services Deploy URI : amserver
    Access Manager Cookie Domain List : .myreliancemail.com
    Access Manager Common Domain Deploy URI : amcommon
    Access Manager Directory Server Host Name : RADAGWMSG221
    Access Manager Directory Server Host : RADAGWMSG221.myreliancemail.com
    Access Manager Directory Server Port : 389
    Access Manager Directory Root Suffix : o=rmail
    Access Manager Directory Manager DN : cn=Directory Manager
    Organization Marker Object Class : sunISManagedOrganization
    User Marker Object Class : inetorgperson
    Organization Naming Attribute : o
    User Naming Attribute : uid
    Sun Java(TM) System Messaging Server 6.3 :
    Messaging Server Installation Directory : /opt/SUNWmsgsr
    Sun Java(TM) System Communications Express 6 :
    Communications Express Installation Directory : /opt/SUNWuwc
    Communication Services Delegated Administrator :
    Communication Services Delegated Administrator Installation Directory : /opt/SUNWcomm
    {color}

    Rushi-Reliance wrote:
    Kindly let us know how to proceed further as we are waiiting some reply from your team.As I already advised in your previous posting (http://forums.sun.com/thread.jspa?threadID=5359095), you are best off re-installing solaris from scratch and installing Communication Suite 6 update 1 if you cannot get Access Manager 7.1 configured.
    Regards
    Shane.

  • Java Bean access in a JSP Tag handler class

    Hello Everybody,
    I am trying to access my java bean(ErrorBean.java) in th doEndTag() method of the tag handler class(MyTagHandler.java) and iam getting an "CLASSCAST EXCEPTION"
    I am doing it like this in the tag handler class.
    MyBeans.ErrorBean errorBean = (MyBeans.ErrorBean)pageContext.getSession().getAttribute("ErrorBean");
    Where MyBeans is the package in which my Error Bean is and iam placing the ErrorBean object in the session object before it comes to the jsp page where i have the jsp Custom tag:
    <%@ taglib uri="/WEB-INF/taglib.tld" prefix="errors" %>
    <errors:message/>
    <%@ include file="footer.jsp"%>
    I was of the opinion that i was casting it right...can anyone help me to find ...where iam doing it wrong...its really URGENT ..PLEASE

    Friend that did not work either ...
    u know what...the ErrorTagHandler class is comiling fine with out errors but in the jsp page when the custom tag is hit..this error is showing up when i see the server log.
    can you throw some light on this..
    thanks..
    Firasath

  • How create plugins in java and access then from the app

    How can I create plugins for a Java app. And how do I need in my app to access those plugins??

    Generally speaking, any sort of plugin is simply an implementation of some defined or set of defined interfaces that is loaded at runtime and invoked based on some event, configuration or other such mechanism. Java plugins can be implemented simply as .jar or individual classes that implement the interface(s). The application loads these (perhaps using separate, specifically defined class loaders) and is responsible for knowing how and when to invoke their method(s).
    The trick, of course, is defining the interfaces to be supported by the app and implemented by the plugin and to define a set of events, etc. that would cause these to be invoked. The mechanics of loading the classes, instatiating the instances as need, etc. is fairly basic Java programming.
    Chuck

  • Java Program accessing hardware driver

    I am planning to develope a project with a USB smart card reader. The USB smart card reader is for some form of authenication purpose of the card holder to verify that the authenticated user is using the program. The application will be a web based program in which a java applet (or java application) will be developed for the web page to access the local USB smart card reader. Can Java Applet has some form of ability to access the hardware, either by accessing the smart card API or it can directly access the USB port to read/write information directly to the smart card reader, provided that the USB reader can provide the low-level communication protocol.

    You will have to sign your applet
    And you might also need native libraries to access
    the card readerThanks for your prompt help.
    Because I am quite new to Java, I might ask some naive question.
    When you "sign" the applet, which I believe it will be done in the browser setting to trust the applet, this will loosen the security concern of the applet, right?
    The native libraries should then be in the form of a DLL in windows environment which the Java applet can call, right? And could you provide some sample code that how a DLL function call can be integrated into Jave.
    Thanks again for your help.

  • Java.security.Access denied exception

    hello all,
    iam new to java please help me .
    my program has thrown the exception:
    java.security.AccessControlException: access denied (java.io.FilePermission F:\
    read)
    using applets a dynamic jtree should be displayed.
    when a user clicks a node a file should be retrived and display the directories and files in it.
    the program code is:
    public void mouseClicked(MouseEvent me)
    TreePath tp = Tree.getPathForLocation(me.getX(),me.getY());
    String dirname = tp.toString();
    File f =new File("F:\\");
    int w =st.length();
    String y = st.substring(1,w-1);
    File f2 = new File(y);
    String v[] = f2.list90;
    for(int u=0;u<v.length;u++)
    System.out.println(v); //checking atleast o/p may display in command prompt.
    any idea reply soon
    it's very urgent.
    usha

    This forum is specific to the Message Queue product ....
    for general questions, you may want to start at the "new to java" forum
    http://forum.java.sun.com/forum.jspa?forumID=54

  • Java and Access database

    Hello,
    I have an application with an access database. The access database (the access file) is in the same directory as all java files in c:\programs\eclipse\workspace\javaBooks.
    The connection method looks as follows:
    public boolean getConnection(String url,String user, String passw)
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         con = DriverManager.getConnection(url,user,passw);          
    DatabaseMetaData dbmd = con.getMetaData();
         System.out.println("Connected to " + dbmd.getURL());
         System.out.println("Version " + dbmd.getDriverVersion());
         System.out.println("DBMS: " + dbmd.getDatabaseProductName());
         return true;
         //System.out.println("AutoCommit: " + con.getAutoCommit());
         //rs=dbmd.getTables(null,"%","%",null); // Driver is not capable!
         catch (java.sql.SQLException e)
              System.err.println("Can't connect to database");
              System.err.println(e.getMessage());
              return false;
         catch (ClassNotFoundException e)
              System.err.println("Can't connect to database");
              System.err.println(e.getMessage());
              return false;
    At the beginning when I start the application a form is displayed where I have to indicate an url and a password.
    Does anybody know how I have to configure the corresponding things to use the database with the application?

    You access (ahem) Access through the JdbcOdbcDriver,
    which comes with Java.Not bad, not bad.
    World spins
    RD-R
    � {�                                                                                                                                                                                                                                                   

  • Client-Side Java Application accessing a database

    Hello Sun Forums,
    I'm developing a Java based client application which accesses a MySQL database server via JDBC.
    My question is: How can I store the password for accessing the database in a secure way on the client? I'm looking for something like the Oracle wallet. I don't know if there is a solution to this problem. Any user could do reverse engineering and extract the password out of the source code. One way hash algorithms don't work either. Any help concerning this topic is highly appreciated.
    Thanks, Yves

    YvesW wrote:
    Hello Sun Forums,
    I'm developing a Java based client application which accesses a MySQL database server via JDBC.
    My question is: How can I store the password for accessing the database in a secure way on the client? I'm looking for something like the Oracle wallet. I don't know if there is a solution to this problem. Any user could do reverse engineering and extract the password out of the source code. One way hash algorithms don't work either. Any help concerning this topic is highly appreciated.From your subsequent descriptions any 3rd party product will still not be a satisfactory solution. What you can do is to not make the DB visible by the end user and query only through request to a webserver. If you wish to adhoc type of queries, you can have a sql validation request, if your sql server supports that.
    If you cannot use a webserver interface, then throw the idea out about saving the client password, the user is just going to have to enter their password. If you are worried about entering the password and cannot use a webserver, then you don't have a project.
    Have the client call on the phone and request an extract, then send it to them on a DVD. But that can be intercepted in the mail. Even if it's encrypted, they have your data and eventually they will decrypt it.
    BTW: security is only an illusion that lets us sleep at nights, in reality, it is nothing more than a hinderance: if someone really wants to access your web connected resource, then they are going to eventually find a way to do it.

Maybe you are looking for

  • Excise duty on free item

    Hello experts,                      In a Scheme an Excisable item is given for free along with sale of other items.In the case of items given as free, ED has to be paid but cannot be collected from the customer.  How this can be done in invoice witho

  • How to put files in Oplayer hd with itunes

    I am trying to setup oplayer hd to watch movies on my ipad.  To stream them from my IMac using Oplayer hd to my ipad mini. I have found a description of how to do this at: www.blogtechnika.com/watch-any-video-on-your-iphoneipad-with-oplayer/ The desc

  • Anyone back-up iTunes or iPhoto using new TC?

    Just curious if anyone has used it to back up those applications. That is the main reason why I have bought the TC. Wireless access for the whole family to iPhoto and Itunes. ??

  • Group Email in Lightroom 4

    I can create an email group in the Lightroom address book but when I click on the group it doesn't go into the "To:" section of the email so creating the group was of no value. Help?

  • How to remove the entries of the names of the previously read PDF files in order to not to leak privacy

    How to remove the entries of the names of the previously read PDF files in order to not to leak privacy