MS Access and Java JDBC help!

Hello, I having trouble with a java GUI.
I have a MS Access named Database.mdb with a table named Customer which I want my GUI to access.
I want my GUI to be able to flick through the records using the field I have made for them.
I already have connected the database using windows xp's "System DSN" and have no problem creating tables using sql statements in my code
Who can help me? any information would be great.
Thanks

I'm doing an inventory software application too...but my application is an automatic software inventory, is automatic your application??
My result is the software that are intalled in a machine..is your project too?
Sorry, my english is not very good...

Similar Messages

  • Java.io and java.swing help

    i'm writing a program that write the byte representation of numbers and outputs them to a joptionpane window
    it keeps telling me that void functions are not allowed
    is there any way that i can use void functions in my output? or would i need to change to a method that returns a value?
    here is my code, please help me, it will be greatly appreciated :)
    GUI Part
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class zero2nineTest extends JFrame{
         zero2nine show;
         public static void main(String[] args){
              zero2nineTest x = new zero2nineTest();
              x.setVisible(true);
         public zero2nineTest(){
              super("File IO and Byte Representation Tests");
              Container cp = getContentPane();
              cp.setLayout(new FlowLayout());
              JButton readFile1 = new JButton("Create and Read 1st Byte Representations");
              readFile1.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        zero2nine.writeFile(out);
                        JOptionPane.showMessageDialog(
                             zero2nineTest.this,
                             "Odd numbers: " + zero2nine.readFile(), "Byte Representation of Odd Numbers",
                             JOptionPane.PLAIN_MESSAGE);
                   cp.add(readFile1);
              JButton readFile2 = new JButton("Create and Read 2nd Byte Representations");
              readFile1.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        zero2nine.writeFile2(out);
                        JOptionPane.showMessageDialog(
                             zero2nineTest.this,
                             "Even numbers: " + zero2nine.readFile2(), "Byte Representation of Even Numbers",
                             JOptionPane.PLAIN_MESSAGE);
                   cp.add(readFile2);
              JButton quit = new JButton("Quit Program");
              quit.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        int decision;
                        decision = JOptionPane.showConfirmDialog(
                             null, "Are you sure?", "Are you sure?", JOptionPane.YES_NO_OPTION);
                             if(decision == 0){
                                  System.exit(0);
                   cp.add(quit);
                   pack();
    Class Part
    import java.io.*;
    class zero2nine{
         static String fileName = "zero2nine.txt";
    //     public static void main(String[] args){
    //          try{
    //               FileOutputStream out = createFile();
    //               writeFile(out);
    //               writeFile2(out);
    //               readFile();
    //               readFile2();
    //          }catch(IOException io){
    //               System.out.println("closing program");
         static FileOutputStream createFile() throws IOException{
              File f = new File(fileName);
              FileOutputStream out = new FileOutputStream(f);
              return out;
         static void writeFile(FileOutputStream out) throws IOException{
              DataOutputStream ds = null;
              try{
                   ds = new DataOutputStream(out);
                   int x = 0;
                   for(int i = 0; i < 10; i++){
                        x = i * i;
                        ds.writeInt(x);
              }finally{
                   System.out.println("File written this far");
         static void writeFile2(FileOutputStream out) throws IOException{
              DataOutputStream ds = null;
              try{
                   ds = new DataOutputStream(out);
                   int x = 0;
                   for(int i = 10; i < 20; i++){
                        x = i * i;
                        ds.writeInt(x);
              }finally{
                   System.out.println("File written this far again");
         public int readFile() throws IOException{
              DataInputStream dataIn = null;
              try{
                   FileInputStream in = new FileInputStream("zero2nine.txt");
                   dataIn = new DataInputStream(in);
                   //Output odd numbers
                   for(int i = 0; i < 10; i++){
                        if(dataIn.readInt() % 2 == 0){
                             int b = dataIn.readInt();
                             System.out.println(b);
              }finally{
                   System.out.println("File read this far");
                   return(b);
         static void readFile2() throws IOException{
              DataInputStream dataIn = null;
              try{
                   FileInputStream in = new FileInputStream("zero2nine.txt");
                   dataIn = new DataInputStream(in);
                   //Output even numbers
                   for(int i = 10; i < 20; i++){
                        if(dataIn.readInt() % 2 == 1){
                             int b = dataIn.readInt();
                             System.out.println(b);
              }finally{
                   System.out.println("File read this far again");
    }

    F:\Computer Science\Java\zero2nineTest.java:28: cannot resolve symbol
    symbol: variable out
                        zero2nine.writeFile(out);
    ^
                   public void actionPerformed(ActionEvent e){
                        zero2nine.writeFile(out);
                        JOptionPane.showMessageDialog(
    F:\Computer Science\Java\zero2nineTest.java:31: 'void' type not allowed here
                             "Odd numbers: " + zero2nine.readFile(), "Byte Representation of Odd Numbers",
    ^
                             zero2nineTest.this,
                             "Odd numbers: " + zero2nine.readFile(), "Byte Representation of Odd Numbers",
                             JOptionPane.PLAIN_MESSAGE);
    F:\Computer Science\Java\zero2nineTest.java:41: cannot resolve symbol
    symbol: variable out
                        zero2nine.writeFile2(out);
    ^
                        zero2nine.writeFile2(out);
                        JOptionPane.showMessageDialog(
                             zero2nineTest.this,
    F:\Computer Science\Java\zero2nineTest.java:44: 'void' type not allowed here
                             "Even numbers: " + zero2nine.readFile2(), "Byte Representation of Even Numbers",
    ^
                             zero2nineTest.this,
                             "Even numbers: " + zero2nine.readFile2(), "Byte Representation of Even Numbers",
                             JOptionPane.PLAIN_MESSAGE);
    4 errors
    Tool completed with exit code 1

  • Vista, Access, and Palm ZZ--help!!

    Hello.  I have had my palm for almost 3 years.  Just recently I had a blob on my calendar.  To fix that I had to download Access, since I have Windows Vista.  It is working fine now, but how do I put photos on my palm?  I used Splash Photo before, but now have media on Access.  I have the photos on the Palm Desktop, but when I try to move them to install it says it is not supported.  Is the install tool not compatible with Vista? It was my understanding that that is what Access is for.  Please help me!!
    Post relates to: Palm Z22
    This question was solved.
    View Solution.

    You need to install the spash photo on the PC so the conduits in the Hotsync manager and be updated to sync photos. You will need your Z22 CD.
    Put the CD in. It should try to install if it does just cancel it if not don't worry less for you to do.
    Next you want to go into your computer. From there right click on the CD ROM drive and either click open or explore.
    Then select English.
    Then Photos.
    Then double click on splashphoto.exe.
    then you should be able to sync your photos.
    Post relates to: Treo 800w (Sprint)

  • Accessibility and Java GUI testing

    Hi,
    Can java accessibility be used for developing java GUI testing tool for applet embedded in IE? If not is there any other way we can test Java Appet GUI?
    best regards
    Krishna

    I do not know of a free tool, but you can use the Robot class in Java to create what you need.

  • Classpath and java.exe, help me, guys

    if i don't use -classpath for java.exe, what else i can do which affects -classpath or class enviromnent?
    thx

    You can set the classpath in your system environment or in your IDE (if you use one)

  • MS Access And Forms

    I m working on a project where i was first having oracle as database but due to customer requirement he want ACCESS
    But i dont know how to connect to access and forms
    PLS HELp
    Its Urgent

    Sumit,
    Forms 9i and above no longer support ODBC conenctions to Access.
    Frank

  • b font color ='red' Java JDBC and Oracle DB URGENT HELP PLEASE /font /b

    Hello, I am a newbie. I'm very interested in Java in relation to JDBC, Oracle and SAP.I am trying to connect to an Oracle DB and I have problems to display the output on the consule in my application. What am I doing wrong here . Please help me. This is my code: Please Explain
    import java.sql.*;
    import java.sql.DriverManager;
    import java.sql.Connection;
    public class SqlConnection {
         public static void main(String[] args) {
              Class.forName("oracle.jdbc.driver.OracleDriver"); //Loading the Oracle Driver.
              Connection con = DriverManager.getConnection
              ("jdbc:orcle:thin:@34.218.5.3:1521:ruka","data","data"); //making the connection.
              Statement stmt = con.createStatement ();// Sending a query to the database
              ResultSet rs = stmt.executeQuery("SELECT man,jean,test,kok FROM sa_kostl");
              while (rs.next()) {
                   String man = rs.getString("1");
                   String jean = rs.getString("2");
                   String test = rs.getString("3");
                   String kok = rs.getString("4");
                   System.out.println( man, jean, test,kok );//here where my the
                                                 //compiler gives me errors
              stmt.close();
              con.close();
    }

    <b><font color ='red'>Java JDBC and Oracle DB URGENT HELP PLEASE</font></b>Too bad your attempt at getting your subject to have greater attention failed :p

  • How can  I access my java class file in a .jar file ...PLz Help anyone!!

    Hi Folks,
    I am new in Java programming, have a .jar file that contains .java files that I want no access and use from another .java file. These files in the .jar file basically form a library thus have no main-method. However I can not declare an instance of the library (in the .jar file) and use it within my program.
    Plz help ...I have tried all I know in vain.
    Thanks.

    temba wrote:
    Hi Folks,
    I am new in Java programming, have a .jar file that contains .java files that I want no access and use from another .java file. These files in the .jar file basically form a library thus have no main-method. However I can not declare an instance of the library (in the .jar file) and use it within my program. You are making little sense. You can't instantiate .java files.
    Plz help ...I have tried all I know in vain.
    Thanks.Could you post WHAT you have tried and also post what error messages you received?

  • Jdbc and java stored procedures

    Hi all,
    I am new to Oracle Java Stored Procedures but I am interested in knowing to which extent is object passing supported.
    Can I send any kind of object to a java stored procedure? And back from the procedure? Anybody knows any good resources online about Java Stored Procedures and JDBC?
    I also saw that to pass the string back you need to specify java.lang.string, how would I do in order to pass back a user defined object, do I have to register the class in Oracle before (and if yes, how?)or is the classpath enough?
    Many thanks,
    A.

    Hi again,
    perhaps I didn't understand exactly what you meant with "publish", AFAIK you have to expose the java class (i.e. RowCounter) by using
    CREATE OR REPLACE FUNCTION row_count (tab_name VARCHAR2) RETURN NUMBER
    AS LANGUAGE JAVA
    NAME 'RowCounter.rowCount(java.lang.String) return int';
    (BTW this works fine)
    or else you cannot access the java class you loaded on the server, and that's where my questions arose. What if I am passing an object, let's say myObject, shouldn't I use the STRUCT mapping then or something like that?
    Or, could you clarify what do you mean by publishing to SQL, I just need to access the class from jdbc, not from PL/SQL or others, but as I understand to call the class from JDBC I need to call the function or procedure that calls the class and then I could call it from PL/SQL as well...
    Thanks,
    A.

  • Why signed and get "access denied (java.io.FilePermission hello.txt read)"?

    I am learning the Java tools and policy to create some local browser application for personal use. So I signed a jar file with jarsigner, keytool and policytool and still trying to figure out why my browser application cannot read a simple local text file.
    My question are
    1. Why use java policy tool (policytool.exe)? If I signed a .jar with keytool and jarsigner, do I really need java policytool to write a policy?
    2. What is the maximum validity days? 365? or more? Do I need to sign again when validity expire?
    3. I don't want any of my local browser application gets to internet but only work with local files (read, write, or execute). how do I do that?
    4. how to use java security policy to grant access to the jar applet? where do I place and import the policy file so the hosting web browser and the applet can work?
    My java applet is a simple class that read a text line from a local file in the same folder, and pass the result to a calling web browser Javascript.
    Currently the result in the web page is the error message below, even though the jar is signed correctly.
    access denied (java.io.FilePermission hello.txt read)
    Someone please help and enlight the newbie!

    leoku wrote:
    I am learning the Java tools and policy to create some local browser application for personal use.Why would you wrap a mostly useless and unhelpful browser window around a Java app. for 'local' use?
    .. So I signed a jar file with jarsigner, keytool and policytool and still trying to figure out why my browser application cannot read a simple local text file.
    My question are
    1. Why use java policy tool (policytool.exe)? If I signed a .jar with keytool and jarsigner, do I really need java policytool to write a policy?No. In fact, don't stuff around with policy files - they are a path to madness.
    2. What is the maximum validity days? 365? or more?Keytool accepts an argument for the number of days to remain valid. I do not believe it has an upper limit, but it might be best to experiment with it and find out for yourself. Please report your findings back.
    (2a) Do I need to sign again when validity expire?No, but the end user gets a huge warning that the certificate has expired. Further, if it was a certificate that was certified by a CA, the 'always trust' check box which used to default to true, would now default to false.
    3. I don't want any of my local browser application gets to internet but only work with local files (read, write, or execute). how do I do that?I am not sure I understand, but if you only offer a JFileChooser for the applet to access resources, that should restrict it to resources off the local file-system. Of course, that would not restrict the end user from downloading something from the internet to their local disks, then accessing it using the applet.
    4. how to use java security policy to grant access to the jar applet? where do I place and import the policy file so the hosting web browser and the applet can work?The only place it will work is in the JRE directories of the end-user's machine. Even if you find a way to install your local policy file, do not go messing with the end-user's policy files.
    My java applet is a simple class that read a text line from a local file in the same folder,.. In the 'same folder' as what? (1)
    ..and pass the result to a calling web browser Javascript. That might be the problem. AFAIR, using JS with trusted applets causes the security to be tightened. Perhaps it could be fixed by calling System.setSecurityManager(null) on applet init(), but I have also seen references to using [AccessController.doPrivileged()|http://java.sun.com/j2se/1.4.2/docs/api/java/security/AccessController.html] to wrap the problematic code. I am hazy on the details of how/if that works.
    Currently the result in the web page is the error message below, even though the jar is signed correctly.
    access denied (java.io.FilePermission hello.txt read)
    1) If the answer to my question is what I suspect, there may be better ways to access the resource that are usable even in a sand-boxed app.

  • Please, help me with file access in Java Applet.

    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class ImageVi extends Applet {
         URL PicPath1;
         Image Img1;
         public void init()
              try
                   PicPath1 = new URL("http://nurchi.far.ru/pic/s08.jpg");
              } catch (MalformedURLException Excep1) {}
         public void paint(Graphics g) {
              Img1=getImage(PicPath1);
              g.drawImage(Img1, 10, 10, this);
    The error message is:
    Exception occurred during event dispatching:
    java.security.AccessControlException: access denied (java.net.SocketPermission nurchi.far.ru resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:195)
    at java.security.AccessController.checkPermission(AccessController.java, Compiled Code)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compiled Code)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1019)
    at sun.awt.image.URLImageSource.<init>(URLImageSource.java:48)
    at sun.applet.AppletImageRef.reconstitute(AppletImageRef.java:40)
    at sun.misc.Ref.get(Ref.java:53)
    at sun.applet.AppletViewer.getCachedImage(AppletViewer.java:275)
    at sun.applet.AppletViewer.getImage(AppletViewer.java:270)
    at java.applet.Applet.getImage(Applet.java:190)
    at ImageVi.paint(ImageVi.java:24)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:116)
    at java.awt.Component.dispatchEventImpl(Component.java:2452)
    at java.awt.Container.dispatchEventImpl(Container.java:1059)
    at java.awt.Component.dispatchEvent(Component.java:2312)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:301)
    at java.awt.EventDispatchThread.pumpOneEventForComponent(EventDispatchThread.java:120)
    at java.awt.EventDispatchThread.pumpEventsForComponent(EventDispatchThread.java:95)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:90)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

    Applets are not allowed to connect to other server
    than the one they were loaded from. This is probably
    the reason here.You mean that I can use the applet after uploading on my web-site and using "getDocumentBase()" only?
    OK.
    The applet works perfectly if I use that function, but I have another question.
    If I want to use something like:
    Img1=getImage(getDocumentBase(), "s01.jpg");
    it works perfectly.
    If I do the fillowing:
    Img1=getImage(getDocumentBase(), "pic/s01.jpg");
    it also works.
    But is it possible to go a level up?
    Like:
    Img1=getImage(getDocumentBase(), "../pic/s01.jpg");
    That is if an applet is in one folder and the pictures are in another, but to get to them I have to go a level up and then enter another folder.
    Please help.
    Thanks.

  • Q: How to access and modify xml tags using Java

    I have an xml based document that i need to access and change. For example, the code
    <section id="section1">
    <div>
    <xforms:group id="id1">
    <xforms:label id="label1">
    <l style="font-size:16pt"> something </l>
    </xforms:label>
    </xforms:group>
    </div>
    </section>
    Working with Java I need to access all the tags, select some of them that are relevant to the current device and remade the document. I thought I would read the file character by character identifying the different labels and building a tree, storing in the tree nodes the relevant information as some kind of attributes (for example, in the case of the <xforms:group id="id1"> I would name the node "xforms:group" and create an "id" attribute with value "id1"). I'm not sure if that is the most efficient way of accessing the problem (computational power might be an issue), and would appreciate some help on the subject.
    Thanks,

    this may help you..
    this is a little util i made to help me read/write files.
    using this, you are only one step away from your solutions, you only need to figure out the regex you need to run on the text of the file to make it become what you need it to become.
    though if you use non-standard encoding, you might not want to use this code..
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Arrays;
    public class ASCIIFile {
         private File file;
         private StringBuilder builder;
         public ASCIIFile(String path) throws IOException{
              file = new File(path);
              openFile();
         public ASCIIFile(File file) throws IOException{
              this.file = file;
              openFile();
         public void setNewFileName(String fileName){
              file = new File(file.getAbsolutePath(), fileName);
         public void setNewFilePath(String filePath){
              file = new File(filePath, file.getName());
         private void openFile() throws IOException{
              if(!file.exists()) file.createNewFile();
              BufferedReader read = new BufferedReader(new FileReader(file));
              String line = read.readLine();
              builder = new StringBuilder();
              while(line != null){
                   builder.append(line);
                   builder.append("\n");
                   line = read.readLine();
              read.close();
         public String getContents(){
              return builder.toString();
         public StringBuilder getStringBuilder(){
              return builder;
         public void setStringBuilder(StringBuilder b) throws IOException{
              setContents(b.toString());
         public void setContents(String contents) throws IOException{
              FileWriter writer = new FileWriter(file);
              writer.write(contents);
              writer.flush();
              writer.close();
              builder = new StringBuilder(contents);
         public static File[] getAllFilesUnderDir(String fullpath, boolean recursive) {
              ArrayList queue = new ArrayList(10);
              ArrayList matched = new ArrayList();
              File root = new File(fullpath);
              File[] files = root.listFiles();
              if (files == null || files.length == 0) {
                   return new File[] {};
              queue.addAll(Arrays.asList(files));
              for (int j = 0; j < queue.size(); j++) {
                   File child = (File) queue.get(j);
                   if (child.isDirectory() && recursive) {
                        files = child.listFiles();
                        if (files != null) {
                             queue.addAll(Arrays.asList(files));
                   } else { // child is file
                        matched.add(child);
              return (matched.size() > 0)?((File[]) matched.toArray(new File[] {})):(new File[] {});
    }

  • Access denied java.lang.RuntimePermission accessClassInPackage.sun.jdbc.

    When i am running my applet program with database the following message is displayed in command prompt .
    " access denied <java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc> "
    Above program is running fine without applet i.e. normal java application

    @OP
    Well this is bound to happen my friend..In general are designed to be more secure & don't have adequate access to System(Fils,Audio,SSL,Native Code,Database.. & etc) resources.
    Well need sign the applet inorder to do that.
    you may go through the link given below to which provides details about siging an applet.
    http://java.sun.com/docs/books/tutorial/security/tour1/step1.html
    http://download-east.oracle.com/docs/cd/B14117_01/java.101/b10979/applet.htm#i1004498
    (An advice)It is not a gud practise of using vunerablities where there is a security restrcition... we might quite often mishandle resources in this case.
    Hope this might be of some help :)
    REGARDS,
    RaHuL

  • J2me and java card, need help to communicate

    we are trying to put together a reader to read smartcards using j2me and we figure that it would be easiest if we could develop it to work with java cards rather than standard smart cards, the problem is we get garbage when we communicate to it, the chip sends us crap, any suggestions what might be wrong, any calls we might be missing, has anyone worked with j2me and java cards or smart cards, any help would be appreciated.
    einar

    .... reader app and the ME behind it .... smells like mobile ....
    First of all - if you want to have one mobile application running on this just make sure that whatever is written in ME can use drivers from the reader chip ....
    Workin on the PC is something completely different. There was one good example how to develop one host application in Java provided with the JCOP tools long ago ... I don't know if this is now in the new Eclipse tools.
    But - there was a small API provided that can give you good hints what to do - and - once you have it on the reader side - you can easily integrate ME methods with this ...

  • I continually get a Java error. I've uninstalled and reinstalled firefox and nothing has helped. I've updated flash and Java.

    I have used Firefox as my default browser for many years. I've recently started getting a Java error message. It pops up continually. I have updated flash and java. I have uninstalled and re-installed Firefox and nothing has helped. I have had to start using Chrome instead of Firefox which I don't care for but I don't have the java error with Chrome. How do I fix this problem? The error reads as follows:
    Java Script Application
    Error: syntax error

    Your '''JavaScript''' error has nothing to do with the Java plugin . It is likely caused by an added extension (the earlier forum threads [/questions/944619] and [/questions/943088] mention disabling or updating the Social Fixer extension will resolve the problem).
    You can read this article for help troubleshooting your extensions: [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

Maybe you are looking for

  • How can I create an interactive form in Captivate 5?

    Hello... I'm creating a Captivate project for an elearning course that will be posted to an LMS.  I'd like to create an "Action Plan" at the end where users can click various actions they want (from a list) and then print that page to use as a take-a

  • Multiple Amount Columns

    I'm setting up an import format for a text file (to load data into Essbase) that has more than one column with an amount in it. e.g. column 1 is expense dollar amount, and column 5 is hours. the expense gets loaded to the account shown in column 2, a

  • OSX: FF running, but no windows open - clicking on the dock icon should open a new window.

    Running OSX 10.5.8, FF3.6.10. If I close all FF windows, but leave FF running, I should be able to open a new FF window by clicking the dock icon. This doesn't work - it just brings FF to the front, but no windows open. Any ideas how I can fix this?

  • Totaling in OA AdvancedTable

    Hi, I've a OAAdvancedTable in my page, with "Total" enabled for few columns. I'm getting the Total Row embedded as Last row in the table, but with all the Values coming as Zero(0). I'm not sure, how to debug this. Can anyone throw some light on how t

  • Comment choisir sa caméra IP ?

    Bonjour, Je travaille actuellement sur l'amélioration d'un programme sous vision. Il s'agit d'un programme qui avait été dévellopé pour le concour robotique des NI days. L'idée était de visualiser les couleurs du rubic's cube, et de déterminer de qu'