Its possible to access CommDb from Java?

Hello.
The subject above is my question.
CommDb is a internet database. I want to edit this database like GnuBox does (http://mobile.linux.pt/p800/symbianlinuxhowto).
Anyone knows if its possible or not? If the answer is yes can you tell me how? Will it work with N6600?
I thank you in advance!
Rui
(BIG HELLO FROM PORTUGAL - Come to visit me in Euro 2004 :) )

You can't do that with J2ME because of the "sandbox" security model. Maybe on devices that allow access to the filesystem you could find a way to hack it, but the 6600 isn't one of those devices.
shmoove

Similar Messages

  • Calling MS Access queries from Java

    Anyone have any idea if it's possible to call MS Access queries from Java? I have a client who is insistent on keeping MS Access for their database, and it'd be nice if I didn't have to receate all their queries in Java.
    I've successfully connected to and queried the Access MDB, but I need to know if it's even possible to execute the stored MS Access queries they have setup in the database.
    Thanks!

    See reply 6 in the following....
    http://forum.java.sun.com/thread.jspa?forumID=48&threadID=203818

  • Accessing SAP from JAVA

    Hi Friends,
       I've a requiremnet to create SO where data will be provided in JAVA screens. Is there any way to access SAP from java as we can do this through VB using API methods.
    Regards,
    Anupam

    see these links
    [link1|http://www.sapdevelopment.co.uk/java/jco/jcohome.htm]
    [link2|http://searchsap.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid21_cid417095,00.html]
    [link3|http://www.experts-exchange.com/Database/Software/ERP/SAP_ERP/Q_20693539.html]
    Regards,
    SAPient

  • Jintegra problem - accessing Matlab from Java??

    Hi:
    Sorry if this post doesn't belong here!!
    I am accessing Matlab from JAVA using JIntegra for COM. I tried running the example in their website.
    (http://j-integra.intrinsyc.com/support/com/doc/other_examples/Matlab.htm)
    I have also posted the example below. I am using their trial version and have included all the jars as said. I get the an unexpected output (all zero's) for reading a variable in the matlab workspace. I don't understand why I get this. Can anyone let me know if this runs for you??
    Thanks
    Pavan
    Example code from Jintegra website:
    public class MatlabExample {
    public static void main(java.lang.String[] args) throws Exception {
    try {
    // DCOM authentication: Make sure NT Domain, NT User, NT Password are valid credentials.
    // Uncomment this line if MatlabExample.java remotely accesses MATLAB :
    // com.linar.jintegra.AuthInfo.setDefault("NT DOMAIN", "NT USER", "NT PASSWORD");
    // Create the MATLAB object
    // Specify host name or IP address of MATLAB machine as parameter if
    // MatlabExample.java remotely accesses MATLAB.
    // mlapp.MLApp mlApp = new mlapp.MLApp("123.456.789.0");
    mlapp.MLApp mlApp = new mlapp.MLApp();
    String result = mlApp.execute("a = [1 2 3 4; 5 6 7 8;]");
    System.out.println("Execute result is " + result);
    double mreal[][] = new double[2][4];
    double mimage[] = new double[0];
    mlApp.getFullMatrix("a", "base", new Object[]{mreal}, new Object[]{mimage});
    for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 4; j++) {
    System.out.println(mreal[i][j]);
    } finally {
    com.linar.jintegra.Cleaner.releaseAll();
    }

    ......How are you declaring the class in your JSP? ... are you instantiating it as a bean using the useBean tag, or just instantiating it in your code like normal.
    Maybe you could post the relevant JSP code too?
    Hello again,
    Only the last string is populating after the file has be tokenized. What I'll like to accomplish is passing the very first string in the file. I did not get too far in the JSP file setup because the code is still in it's testing stage, but any help will be highly appreciated.
    Here is the JSP code
    <%@page import="dev.*" %>
    <%@page session="true" language="java" import="java.io.*" %>
    <jsp:useBean id="wagerhist" scope="request" class="dev.RoundDetail2" />
    <html>
    <head>
    <title>Round Detail</title>
    <body>
      <table width="530" bordercolor="#000000" valign="top">
        <tr>
              <td align="left"  width="19%">Game ID<%=wagerhist.string_gameID%></td>
              <td align="left"  width="30%">  </td>
              <td align="left"  width="20%">card1</td>
              <td align="left"  width="31%">  </td>
            </tr>
      </table>
    </body>
    </html>

  • [JDBC][ODBC] How to compact access database from Java ?

    Hello,
    I'm developping a java applcation wich is connected to an MS Access file database.
    For now, I don'y compact it but it would be better.
    So How can I compact an access database from Java ?
    thanks :)

    Hi ypiel,
    Try this:
    1) Download JETCOMP.exe (freeware from Microsoft);
    2) Put the following code in your app (assuming your database file name is: "DB.mdb"):
    try {
    File current = new File("DB.mdb");
    File backup = new File("BACKUP.mdb");
    if (current.renameTo(backup)) {
    Runtime.getRuntime().exec("jetcomp -src:BACKUP.mdb -dest:DB.mdb");
    } catch (Exception e) {
    System.out.println(e.getMessage());
    Best regards,
    YT.

  • Is it possible to pass blob from java to PL/SQL ?

    Hi, I try to bind a PL/SQL function who return a blob to a java class :
    Signature of java method :
        public static Blob getBLOB(int aId, String aJDBC) {Create PL/SQL function :
    create or replace function aa_java(myPiId in number,myPiJDBC in varchar2) return blob
    as language java
    name 'zip.ReadBLOB.getBLOB(int,java.lang.String) return java.sql.Blob';
    /In java code, my blob has the right size (150 Ko) but in PL/SQL, size = 0 !!!
    Any ideas ?

A: Is it possible to pass blob from java to PL/SQL ?

Thank you, but I think I have a Java problem...
Here is my code :
package zip;
import java.sql.*;
import oracle.jdbc.OracleDriver;
import oracle.sql.BLOB;
public class ReadBLOB {
    public static BLOB getBLOB(int aId, String aJDBC) {
        BLOB vBlob = null;
        try {
            DriverManager.registerDriver(new OracleDriver());
            Connection connection = DriverManager.getConnection(
                aJDBC,
            PreparedStatement stat = connection
                .prepareStatement("select image from aa_blob where id="+aId);
            ResultSet rs = stat.executeQuery();
            if (rs.next()) {
                vBlob = (BLOB) rs.getBlob(1);
                System.out.println("Taille 1 : "+vBlob.length());
            connection.close();
        } catch (Exception e) {
            e.printStackTrace();
        return vBlob;
    public static void main(String[] args) throws Exception {
        BLOB vBlob = getBLOB(1, "jdbc:oracle:thin:@vdn-ceg5:1521:DEV5");
        System.out.println("Taille 2 : "+vBlob.getLength());
}When I run the main method, I have :
Taille 1 : 150260
Taille 2 : 86
!!!!????!!!!????

Thank you, but I think I have a Java problem...
Here is my code :
package zip;
import java.sql.*;
import oracle.jdbc.OracleDriver;
import oracle.sql.BLOB;
public class ReadBLOB {
    public static BLOB getBLOB(int aId, String aJDBC) {
        BLOB vBlob = null;
        try {
            DriverManager.registerDriver(new OracleDriver());
            Connection connection = DriverManager.getConnection(
                aJDBC,
            PreparedStatement stat = connection
                .prepareStatement("select image from aa_blob where id="+aId);
            ResultSet rs = stat.executeQuery();
            if (rs.next()) {
                vBlob = (BLOB) rs.getBlob(1);
                System.out.println("Taille 1 : "+vBlob.length());
            connection.close();
        } catch (Exception e) {
            e.printStackTrace();
        return vBlob;
    public static void main(String[] args) throws Exception {
        BLOB vBlob = getBLOB(1, "jdbc:oracle:thin:@vdn-ceg5:1521:DEV5");
        System.out.println("Taille 2 : "+vBlob.getLength());
}When I run the main method, I have :
Taille 1 : 150260
Taille 2 : 86
!!!!????!!!!????

  • Accessing JFX from Java or find a workarround

    Hi there, I'm a new one ...
    I'm working on this project designing applications for a touch panel. I've written a little Java app that uses JNA to access the driver and grab the coordinates of touches on the panel. Works fine so far ...
    Now I'm creating an UI using Java FX. I've got the thing up and running, only experiencing minor problems due to learning JFX.
    When it comes to combining the UI with the Java classes that access the driver I'm not sure how to implement the whole thing. I know it's only possible to access Java from JFX, not the other way arround. My java classes though are the ones who should trigger the events the UI should react to.
    I think I've read something about the possiblity to use reflection to call JFX functions from Java which is one idea I could go with. (if anyone got good links ...)
    The other idea is that I implement a sort of FIFO object where my Java classes drop events and a timer in my JFX classes where I pull them out (not sure if MediaTimer is the right class to go with)
    Any suggestions, tips, etc. ? :)
    Greetings, Alex

    I think that if you create a interface in java and a class in javafx that implements that interface you can then pass that class to java. For instance:
    Java:
    public interface EventReceiver {
        public void receive(String event);
    // Then your java class that generates the events
    public class EventGenerator {
        private List<EventReceiver> receivers = new LinkedList<EventReceiver>();
        public void registerEventReceiver(EventReceiver er) {
            receiver.add(er);
        public void unregisterEventReceiver(EventReceiver er) {
            receiver.remove(er);
         *  Add code that calls EventReceiver.receive(String) method for each element in the receiver list
         *  when the panel is touched.
    }and in the JavaFX code:
    public class JavaFXEventReceiver extends EventReceiver {
        public override function receive(String event) {
            // Do UI updates...
    }A little more indepth version can be found here:
    http://www.compare-review-information.com/pure-java-code-to-call-javafx-class/
    You might run into some problems though pertaining to threading...but there are workarounds for that aswell :)
    - Emil H

  • Printing Access report from Java JButton

    hi would anyone be able to help me i need to print a MS access report from a JButton on a Java interface i have connected to the database using JDBC-ODBC and can retrieve data from the table and store it in text fields on java GUI however i have problems when it comes to printing the reports.
    Help I Need Somebody. :)

    Not possible using Java.
    I would guess that it is possible to do this using C/C++ and windows API calls. And once you figured that out then you could use JNI to call that code and that would allow you to use java.
    I can think of one other odd solution....
    1. Acquite 'AutoIt' - search for it on google
    2. Create an AutoIt script that runs Access, opens the database and runs the report.
    3. Use Runtime.exec() in Java to run AutoIt passing in the script from 2.

  • Is it possible to access Pages from an web application running in Safari in i-Pad?

    Is it possible to access Pages application from an web application running on safari browser in iPad ?

    Since you control the application AND the plugin - you can define ANY method of communication you want.  Shared files, shared memory, IPC, named pipes, etc.

  • Accessing tables from java

    I am creating an inventory system. I have used Java for front-end where i have created forms which display the vendor table, customer table, item table, order table, invoice tbl etc.
    I have created class files for each form that im displaying. i have also made connection to the oracle dbs succesfully. i can access data from the dbs.
    but my problem is,
    1)
    for instance i have created a vendor_master table in oracle with certain constraints like vendor_number can contain only 5 varchar2 characters ,
    eg.
    create table vendor_master
    (v_no varchar2(5) constraint v_no_pk primary key,
    v_name varchar2(25),
    v_add varchar2(15),
    city varchar2(15),
    st varchar2(15),
    zip number(10),
    tel number(11),
    fax number(11));
    now when i want 2 insert any row in the table i should be able 2 insert only "certain" characters of "certain" length depending on the constraints i have set. how do i do tht? coz java does not allow me 2 set the max chars like VB in the properties column
    i have my vendor Master class file here:
    code:--------------------------------------------------------------------------------
    package mainpage;
    import java.io.*;
    import java.io.Serializable;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.String.*;
    import javax.swing.*;
    import javax.swing.JPanel;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.util.Vector;
    import oracle.jdbc.driver.OracleDriver;
    import oracle.jdbc.OracleResultSet;
    import java.sql.PreparedStatement;
    public class VendorMaster extends JPanel implements java.io.Serializable
    JFrame venMastFrame = new JFrame("Vendor Master");
    JLabel vennolbl = new JLabel();
    JLabel venNamelbl = new JLabel();
    JLabel venAdd = new JLabel();
    JTextField venAddtxt = new JTextField();
    JTextField venNotxt = new JTextField();
    JTextField venNmtxt = new JTextField();
    JLabel venCitylbl = new JLabel();
    JTextField venCitytxt = new JTextField();
    JLabel venStlbl = new JLabel();
    JTextField venSttxt = new JTextField();
    JLabel venZiplbl = new JLabel();
    JTextField venZiptxt = new JTextField();
    JLabel venTellbl = new JLabel();
    JTextField venTeltxt = new JTextField();
    JLabel venFaxlbl = new JLabel();
    JTextField venFaxtxt = new JTextField();
    JButton vPrevbtn = new JButton();
    JButton vNxtbtn = new JButton();
    JButton vExitbtn = new JButton();
    JButton vNewbtn = new JButton();
    JButton vDelbtn = new JButton();
    JButton vUpdtbtn = new JButton();
    JButton vSavebtn = new JButton();
    int currentIndex = 0;
    int totalRecords = 0;
    private Vector vendorMasterRecords = new Vector();
    public VendorMaster()
    venMastFrame.setSize(850,760);
    venMastFrame.setVisible(true);
    //venMastFrame.show();
    try
    jbInit();
    } catch (Exception e)
    e.printStackTrace();
    } // end of constructor
    private void jbInit() throws Exception
    Connection myConnection = DataManager.createConnection();
    vendorMasterRecords = loadVendorMasterRecords(myConnection);
    VendorMasterBean vmBean = null;
    venMastFrame.getContentPane().setLayout(null);
    if(vendorMasterRecords != null)
    {                 vmBean = (VendorMasterBean)vendorMasterRecords.elementAt(0);
    totalRecords = vendorMasterRecords.size();
    currentIndex = 0;
    if(vmBean == null)
    vmBean = new VendorMasterBean();
    venNamelbl.setText("Vendor Name:");
    venNamelbl.setBounds(new Rectangle(22, 87, 89, 23));
    venNmtxt.setBounds(new Rectangle(153, 81, 224, 22));
    venNmtxt.setEnabled(false);
    venNmtxt.setText(vmBean.getVendorName());
    venAdd.setText("Address:");
    venAdd.setBounds(new Rectangle(25, 130, 113, 31));
    venAddtxt.setBounds(new Rectangle(152, 126, 201, 22));
    venAddtxt.setEnabled(false);
    venAddtxt.setText(vmBean.getAddress());
    vennolbl.setText("Vendor No:");
    vennolbl.setBounds(new Rectangle(23, 41, 73, 22));
    venNotxt.setBounds(new Rectangle(155, 38, 108, 22));
    venNotxt.setEnabled(false);
    venNotxt.setText(vmBean.getVendorNumber());
    venCitylbl.setText("City:");
    venCitylbl.setBounds(new Rectangle(25, 175, 61, 29));
    venCitytxt.setBounds(new Rectangle(153, 172, 156, 24));
    venCitytxt.setEnabled(false);
    venCitytxt.setText(vmBean.getCity());
    venStlbl.setText("State:");
    venStlbl.setBounds(new Rectangle(25, 225, 64, 32));
    venSttxt.setBounds(new Rectangle(152, 223, 158, 24));
    venSttxt.setEnabled(false);
    venSttxt.setText(vmBean.getState());
    venZiplbl.setText("Zip:");
    venZiplbl.setBounds(new Rectangle(24, 275, 58, 24));
    venZiptxt.setBounds(new Rectangle(150, 272, 108, 24));
    venZiptxt.setEnabled(false);
    venZiptxt.setText(vmBean.getZipcode());
    venTellbl.setText("Telephone No:");
    venTellbl.setBounds(new Rectangle(25, 323, 106, 26));
    venTeltxt.setBounds(new Rectangle(149, 326, 108, 26));
    venTeltxt.setEnabled(false);
    venTeltxt.setText(vmBean.getTelephone());
    venFaxlbl.setText("Fax No:");
    venFaxlbl.setBounds(new Rectangle(27, 375, 97, 26));
    venFaxtxt.setBounds(new Rectangle(149, 375, 107, 26));
    venFaxtxt.setEnabled(false);
    venFaxtxt.setText(vmBean.getFax());
    /* code for buttons */
    vExitbtn.setBounds(new Rectangle(681, 457, 111, 29));
    vExitbtn.setText("EXIT");
    vExitbtn.addKeyListener(new VendorMaster_vExitbtn_keyAdapter(this));
    vExitbtn.addActionListener(new VendorMaster_vExitbtn_actionAdapter(this));
    vPrevbtn.setText("PREVIOUS");
    vPrevbtn.addKeyListener(new VendorMaster_vPrevbtn_keyAdapter(this));
    vPrevbtn.addActionListener(new VendorMaster_vPrevbtn_actionAdapter(this));
    vPrevbtn.setBounds(new Rectangle(14, 457, 110, 29));
    vPrevbtn.setEnabled(false);
    vNxtbtn.setText("NEXT");
    vNxtbtn.addKeyListener(new VendorMaster_vNxtbtn_keyAdapter(this));
    vNxtbtn.addActionListener(new VendorMaster_vNxtbtn_actionAdapter(this));
    vNxtbtn.setBounds(new Rectangle(124, 457, 111, 29));
    vNewbtn.setText("NEW");
    vNewbtn.setBounds(new Rectangle(235, 457, 111, 29));
    vNewbtn.setActionCommand("NEW");
    vNewbtn.addActionListener(new VendorMaster_vNewbtn_actionAdapter(this));
    vNewbtn.addKeyListener(new VendorMaster_vNewbtn_keyAdapter(this));
    vDelbtn.setText("DELETE");
    vDelbtn.setBounds(new Rectangle(346, 457, 111, 29));
    vDelbtn.setHorizontalAlignment(SwingConstants.CENTER);
    vDelbtn.addActionListener(new VendorMaster_vDelbtn_actionAdapter(this));
    vDelbtn.addKeyListener(new VendorMaster_vDelbtn_keyAdapter(this));
    vUpdtbtn.setText("UPDATE");
    vUpdtbtn.addActionListener(new VendorMaster_vUpdtbtn_actionAdapter(this));
    vUpdtbtn.setBounds(new Rectangle(457, 457, 113, 29));
    vUpdtbtn.setMaximumSize(new Dimension(71, 25));
    vUpdtbtn.setMinimumSize(new Dimension(71, 25));
    vUpdtbtn.setPreferredSize(new Dimension(71, 25));
    /* Add all the txtboxes, lbls and buttons to the frame */
    vSavebtn.setBounds(new Rectangle(570, 457, 111, 29));
    vSavebtn.setText("SAVE");
    vSavebtn.addActionListener(new VendorMaster_vSavebtn_actionAdapter(this));
    venMastFrame.getContentPane().add(vennolbl, null);
    venMastFrame.getContentPane().add(venNotxt, null);
    venMastFrame.getContentPane().add(venNamelbl, null);
    venMastFrame.getContentPane().add(venNmtxt, null);
    venMastFrame.getContentPane().add(venAdd, null);
    venMastFrame.getContentPane().add(venAddtxt, null);
    venMastFrame.getContentPane().add(venCitylbl, null);
    venMastFrame.getContentPane().add(venCitytxt, null);
    venMastFrame.getContentPane().add(venStlbl, null);
    venMastFrame.getContentPane().add(venSttxt, null);
    venMastFrame.getContentPane().add(venZiplbl, null);
    venMastFrame.getContentPane().add(venZiptxt, null);
    venMastFrame.getContentPane().add(venTellbl, null);
    venMastFrame.getContentPane().add(venTeltxt, null);
    venMastFrame.getContentPane().add(venFaxlbl, null);
    venMastFrame.getContentPane().add(venFaxtxt, null);
    venMastFrame.getContentPane().add(vPrevbtn, null);
    venMastFrame.getContentPane().add(vNxtbtn, null);
    venMastFrame.getContentPane().add(vNewbtn, null);
    venMastFrame.getContentPane().add(vDelbtn, null);
    venMastFrame.getContentPane().add(vUpdtbtn, null);
    venMastFrame.getContentPane().add(vSavebtn, null);
    venMastFrame.getContentPane().add(vExitbtn, null);
    } // end of jbinit
    public static void main(String[] args)
    VendorMaster vendorMaster1 = new VendorMaster();
    } //end of main
    /* this is where the data will be retrieved from the dbs */
    protected Vector loadVendorMasterRecords(Connection connection)
    //Connection connection = null;
    Vector masterRecords = new Vector();
    // From database getting values
    try
    //connection = connectionManager.getConnection();
    Statement stmt = connection.createStatement();
    String queryall = "Select * from vendor_master order by v_no";
    ResultSet rs = stmt.executeQuery(queryall);
    while (rs.next())
    String vendorNumber = rs.getString("v_no");
    String vendorName = rs.getString("v_name");
    String address = rs.getString("v_add");
    String city = rs.getString("city");
    String state = rs.getString("st");
    String zipCode = rs.getString("zip");
    String telephone = rs.getString("tel");
    String fax = rs.getString("fax");
    VendorMasterBean vendorMasterBean = new VendorMasterBean(vendorNumber,
    vendorName,
    address,
    city,
    state,
    zipCode,
    telephone,
    fax);
    /* data retrieved from the vendormasterbean is then inserted in vector*/
    masterRecords.addElement(vendorMasterBean);
    } // end of while
    } catch (Exception e) // end of try & start of catch
    e.printStackTrace();
    } // end of catch
    finally
    if(connection != null)
    DataManager.freeConnection(connection);
    return masterRecords; /* the data stored in
    masterRecords is passed 2 vendormasterRecords*/
    } // finally ends here
    } // end of loadvendorMasterrecords
    /*example- when previous button is pressed then an event is triggered
    captured by the key listener and then actionPerformed method is called
    which in turn calls the getPreviousRecord*/
    /* to insert records */
    protected void addVendorMasterRecord(VendorMasterBean vmBean )
    Connection connection = null;
    Vector masterRecords = new Vector();
    // first check whether all the textboxes are empty
    // also check whether there is already a record
    //existing with the same v_no
    // From database getting values
    try
    connection = DataManager.createConnection();
    PreparedStatement newRecord = connection.prepareStatement("insert into vendor_master values(?,?,?,?,?,?,?,?)");
    newRecord.setString(1,vmBean.getVendorNumber());
    newRecord.setString(2, vmBean.getVendorName());
    newRecord.setString(3, vmBean.getAddress());
    newRecord.setString(4, vmBean.getCity());
    newRecord.setString(5, vmBean.getState());
    newRecord.setString(6, vmBean.getZipcode());
    newRecord.setString(7, vmBean.getTelephone());
    newRecord.setString(8, vmBean.getFax());
    newRecord.executeUpdate();
    // Insert statement
    // PreparedStatement pStmt = ....;
    // The assign each value in the vmBean to the pStmt
    // and finally execute the pStmt
    } catch (Exception e) // end of try and begin of catch
    e.printStackTrace();
    } // end of catch
    finally
    if(connection != null)
    DataManager.freeConnection(connection);
    }// end of if
    } // end of finally
    } // end of addVendorMasterRecord
    void vNewbtn_actionPerformed(ActionEvent e)
    /* First empty all the textboxes */
    venNotxt.setText(" ");
    venNmtxt.setText(" ");
    venAddtxt.setText(" ");
    venCitytxt.setText(" ");
    venSttxt.setText(" ");
    venZiptxt.setText(" ");
    venTeltxt.setText(" ");
    venFaxtxt.setText(" ");
    venNotxt.setEnabled(true);
    venNmtxt.setEnabled(true);
    venAddtxt.setEnabled(true);
    venCitytxt.setEnabled(true);
    venSttxt.setEnabled(true);
    venZiptxt.setEnabled(true);
    venTeltxt.setEnabled(true);
    venFaxtxt.setEnabled(true);
    vPrevbtn.setEnabled(false);
    vNxtbtn.setEnabled(false);
    void vNewbtn_keyPressed(KeyEvent e)
    /* to delete records */
    protected void removeVendorMasterRecord(VendorMasterBean vmBean )
    Connection connection = null;
    Vector masterRecords = new Vector();
    // From database getting values
    try
    connection = DataManager.createConnection();
    PreparedStatement deleteRecord = connection.prepareStatement("delete from vendor_master where v_no = ?");
    deleteRecord.setString(1, vmBean.getVendorNumber());
    deleteRecord.executeUpdate();
    // Delete statement for where condition pass the vendor number as parameter
    //"delete from vendor_master where v_no = ?"
    //PreparedStatement pStmt = ....;
    // The assign v_no in the vmBean to the pStmt
    // and finally execute the pStmt
    } catch (Exception e)
    e.printStackTrace();
    finally
    // After executing this new record should be removed from the Vector of results.
    // uncomment this
    if(connection != null){
    DataManager.freeConnection(connection);
    } // end of finally
    } // end of removeVendorMasterRecord
    void vDelbtn_actionPerformed(ActionEvent e)
    String vendorNumber = venNotxt.getText();
    String vendorName = venNmtxt.getText();
    String address = venAddtxt.getText();
    String city = venCitytxt.getText();
    String state = venSttxt.getText();
    String zipCode = venZiptxt.getText();
    String telephone = venTeltxt.getText();
    String fax = venFaxtxt.getText();
    VendorMasterBean vmBean = new VendorMasterBean(vendorNumber,vendorName, address, city, state, zipCode, telephone, fax);
    removeVendorMasterRecord(vmBean);
    void vDelbtn_keyPressed(KeyEvent e)
    /* To get next record */
    protected VendorMasterBean getNextRecord()
    VendorMasterBean vmBean = new VendorMasterBean();
    if(currentIndex < totalRecords)
    vmBean =(VendorMasterBean)vendorMasterRecords.elementAt(++currentIndex);
    if(currentIndex == (totalRecords-1) )
    // reached last, so disable the Next button
    vNxtbtn.setEnabled(false);
    // enable the Previous
    vPrevbtn.setEnabled(true);
    } // end of if stmt
    } // end of outer if stmt
    return vmBean;
    } // end of getnextrecord
    void vNxtbtn_keyPressed(KeyEvent e)
    void vNxtbtn_actionPerformed(ActionEvent e)
    VendorMasterBean vmBean = getNextRecord();
    venNotxt.setText(vmBean.getVendorNumber());
    venNmtxt.setText(vmBean.getVendorName());
    venAddtxt.setText(vmBean.getAddress());
    venCitytxt.setText(vmBean.getCity());
    venSttxt.setText(vmBean.getState());
    venZiptxt.setText(vmBean.getZipcode());
    venTeltxt.setText(vmBean.getTelephone());
    venFaxtxt.setText(vmBean.getFax());
    /* to get previous record */
    protected VendorMasterBean getPreviousRecord()
    VendorMasterBean vmBean = new VendorMasterBean();
    if(currentIndex > 0)
    vmBean =(VendorMasterBean)vendorMasterRecords.elementAt(--currentIndex);
    if(currentIndex == 0)
    // reached first so disable the Previous button
    vPrevbtn.setEnabled(false);
    // enable the Next
    vNxtbtn.setEnabled(true);
    } // end of inner if stmt
    } // end of outer if stmt
    return vmBean;
    } // end of previousrecord
    void vPrevbtn_actionPerformed(ActionEvent e)
    VendorMasterBean vmBean = getPreviousRecord();
    venNmtxt.setText(vmBean.getVendorName());
    venAddtxt.setText(vmBean.getAddress());
    venNotxt.setText(vmBean.getVendorNumber());
    venCitytxt.setText(vmBean.getCity());
    venSttxt.setText(vmBean.getState());
    venZiptxt.setText(vmBean.getZipcode());
    venTeltxt.setText(vmBean.getTelephone());
    venFaxtxt.setText(vmBean.getFax());
    void vPrevbtn_keyPressed(KeyEvent e)
    void vUpdtbtn_actionPerformed(ActionEvent e)
    /* when the update button is pressed , only the v_no is disabled
    vPrevbtn.setEnabled(false);
    vNxtbtn.setEnabled(false);
    venNmtxt.setEnabled(true);
    venAddtxt.setEnabled(true);
    venCitytxt.setEnabled(true);
    venSttxt.setEnabled(true);
    venZiptxt.setEnabled(true);
    venTeltxt.setEnabled(true);
    venFaxtxt.setEnabled(true);
    //then the user should press the save button
    void vExitbtn_actionPerformed(ActionEvent e)
    venMastFrame.setDefaultCloseOperation(venMastFrame.EXIT_ON_CLOSE);
    void vExitbtn_keyPressed(KeyEvent e)
    void vSavebtn_actionPerformed(ActionEvent e)
    String vendorNumber = venNotxt.getText();
    String vendorName = venNmtxt.getText();
    String address = venAddtxt.getText();
    String city = venCitytxt.getText();
    String state = venSttxt.getText();
    String zipCode = venZiptxt.getText();
    String telephone = venTeltxt.getText();
    String fax = venFaxtxt.getText();
    VendorMasterBean vmBean = new VendorMasterBean(vendorNumber, vendorName,address, city, state, zipCode, telephone, fax);
    addVendorMasterRecord(vmBean);
    } // end of vSavebtn_actionPerformed
    } // end of class vendormaster
    //Adapter classes
    class VendorMaster_vNxtbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vNxtbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vNxtbtn_actionPerformed(e);
    class VendorMaster_vNxtbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vNxtbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vNxtbtn_keyPressed(e);
    class VendorMaster_vPrevbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vPrevbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vPrevbtn_actionPerformed(e);
    class VendorMaster_vPrevbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vPrevbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vPrevbtn_keyPressed(e);
    class VendorMaster_vExitbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vExitbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vExitbtn_actionPerformed(e);
    class VendorMaster_vExitbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vExitbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vExitbtn_keyPressed(e);
    class VendorMaster_vNewbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vNewbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vNewbtn_actionPerformed(e);
    class VendorMaster_vNewbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vNewbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vNewbtn_keyPressed(e);
    class VendorMaster_vDelbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vDelbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vDelbtn_actionPerformed(e);
    class VendorMaster_vDelbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vDelbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vDelbtn_keyPressed(e);
    class VendorMaster_vUpdtbtn_actionAdapter implements java.awt.event.ActionListener {
    VendorMaster adaptee;
    VendorMaster_vUpdtbtn_actionAdapter(VendorMaster adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.vUpdtbtn_actionPerformed(e);
    class VendorMaster_vSavebtn_actionAdapter implements java.awt.event.ActionListener {
    VendorMaster adaptee;
    VendorMaster_vSavebtn_actionAdapter(VendorMaster adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.vSavebtn_actionPerformed(e);
    the following code is the vendorMasterBean class file- this file helps 2 assign data to the various textboxes.
    code:--------------------------------------------------------------------------------
    package mainpage;
    public class VendorMasterBean
    private String vendorNumber;
    private String vendorName;
    private String address;
    private String city;
    private String state;
    private String zipcode;
    private String telephone;
    private String fax;
    public int Mandatory_Value;
    public VendorMasterBean()
    } // end of constructor
    public VendorMasterBean(String vendorNumber,String vendorName,String address,String city,String state,String zipcode,String telephone,String fax)
    setVendorNumber(vendorNumber);
    setVendorName(vendorName);
    setAddress(address);
    setCity(city);
    setState(state);
    setZipcode(zipcode);
    setTelephone(telephone);
    setFax(fax);
    /* Set Method */
    public void setVendorNumber(String vendorNumber)
    try
    if ( (vendorNumber == null) || (vendorNumber.length() <= 0) || (vendorNumber.length() > 5))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Vendor Number");
    } // end of if stmt
    else {
    this.vendorNumber = vendorNumber;
    } // end of else
    catch(Exception e)
    e.printStackTrace();
    } // end of setVendorNumber
    public void setVendorName(String vendorName)
    try
    if((vendorName == null) || (vendorName.length() <=0 && vendorName.length() > 25))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Vendor Name");
    }// end of if
    else
    this.vendorName = vendorName;
    } // end of else
    } // end of try
    catch(Exception e)
    e.printStackTrace();
    }// end of set method
    public void setAddress(String address)
    try
    if((address == null) ||(address.length() <=0 && address.length()>15))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Address");
    else
    this.address = address;
    catch(Exception e)
    e.printStackTrace();
    public void setCity(String city)
    try
    if((city == null) ||(city.length()<=0 && city.length() > 15))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "City");
    else
    this.city = city;
    catch(Exception e)
    e.printStackTrace();
    public void setState(String state)
    try
    if((state == null) || (state.length()<=0 && state.length() >15))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "State");
    else
    this.state = state;
    catch(Exception e)
    e.printStackTrace();
    public void setZipcode(String zipcode)
    try
    if((zipcode==null) ||(zipcode.length()<=0 && zipcode.length() > 10))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Zipcode");
    else
    this.zipcode = zipcode;
    catch(Exception e)
    e.printStackTrace();
    public void setTelephone(String telephone)
    try
    if((telephone==null) || (telephone.length() <= 0 && telephone.length()> 7))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Telephone");
    else
    this.telephone = telephone;
    catch(Exception e)
    e.printStackTrace();
    public void setFax(String fax)
    try
    if((fax == null) ||(fax.length()<=0 && fax.length() > 7))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Fax");
    else
    this.fax = fax;
    catch(Exception e)
    e.printStackTrace();
    /* Get method */
    public String getVendorNumber()
    return vendorNumber;
    public String getVendorName()
    return vendorName;
    public String getAddress()
    return address;
    public String getCity()
    return city;
    public String getState()
    return state;
    public String getZipcode()
    return zipcode;
    public String getTelephone()
    return telephone;
    public String getFax()
    return fax;
    /* end of get method*/
    } // end of class
    2) the 2nd error is in the save button method , everytme i try 2 save the inserted record it gives me an error.
    in case u need my mainpage.java, here it is
    code:--------------------------------------------------------------------------------
    package mainpage;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JPanel;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    //import java.sql.Statement;
    //import java.sql.ResultSet;
    import oracle.jdbc.driver.OracleDriver;
    import oracle.jdbc.OracleResultSet;
    public class MainPage extends JFrame implements ActionListener
    public static String title = "Warehouse Management System";
    JFrame frame = new JFrame();
    JMenuBar menuBar = new JMenuBar();
    JMenu viewMenu = new JMenu("VIEW");
    JMenuItem vendorItem = new JMenuItem("Vendor Master");
    JMenuItem custItem= new JMenuItem("Customer Master");
    JMenuItem salesrepItem= new JMenuItem("Sales Rep Master");
    JMenuItem itemmastItem= new JMenuItem("Item Master");
    JMenuItem orderItem= new JMenuItem("Order Master");
    JMenuItem invoiceItem = new JMenuItem("Invoice Master");
    JMenuItem payItem= new JMenuItem("Payment Master");
    JMenu transactionMenu = new JMenu("EDIT");
    JMenuItem veneditItem = new JMenuItem("Vendor");
    JMenuItem custeditItem = new JMenuItem("Customer");
    JMenuItem saleItem = new JMenuItem("Rep Information");
    JMenuItem itmeditItem= new JMenuItem("Item");
    JMenuItem ordeditItem= new JMenuItem("Order");
    JMenuItem inveditItem = new JMenuItem("Invoice");
    JMenuItem payeditItem = new JMenuItem("Payment");
    JMenu exitMenu = new JMenu("EXIT

    2 parts to this
    Limit characters in jtextfield using a custom document
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#customdocument
    Specify a custom editor (jtextfield) for jtable (or column)
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#validtext

  • Problems Accessing VARRAY from Java

    Hi,
    I am calling a stored procedure with IN parameters as VARRAYS from Java application.
    There are two schemas in the database. One main schema, say 'MAIN_SCHEMA' which contains all the table,VARRAYS,packages etc. There are public synonyms for all the database object including VARRAYS in this schema. The java application uses a connection pool created using another user say 'ADMIN'. This user has been granted priviliges for acccessing all the objects in the 'MAIN_SCHEMA'. For the VARRAYS we have created public synonyms and granted EXECUTE for ADMIN.
    However when I try to execute the stored procedure from java , I get an SQLException("invalid name pattern: ADMIN.UIDARRAY")
    I solved the problem temporarily by prefixing the main schema name to the name of the VARRAY. The sample code I have used is as below. but I am not sure if this is the correct way of doing it. I do not understand why we have to prefix the schema name if we have priviliges and public synonyms on the object.
    public void setPendingForfeituresUids(java.util.List pendingForfeituresUids) throws DAOException{
    try{
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(
    "MAIN_SCHEMA.UIDARRAY", con);
    array = new ARRAY(descriptor, con, pendingForfeituresUids.toArray());
    if(array == null){
    stmt.setNull(3,java.sql.Types.ARRAY);
    }else{
    stmt.setArray(3, array);
    }catch(SQLException e){
    closeStatement();
    releaseLobWrappers();
    throw new DAOException(e);
    Database and Drivers used
    I am using Oracle 9.2.0.1.0, Weblogic 8.1, Oracle Jdbc thin driver for 9.2 that comes bundled with weblogic (ojdbc14.jar)
    Any help on this is welcome.
    Thanks,
    Sunil

    Hi Sunil,
    I was wondering if you had any solution to the problem you listed.
    We are also facing a similar problem and is reported to oracle. Its a Bug as per oracle.
    Any help in getting this resolved is appreciated.
    Thanks,
    Sandip
    [email protected]

  • Accessing excel from java code

    Hello
    our system uses reportNet to generate reports. When reports are generated in CSV format we have a problem:
    Report consists of people (can be more than one) so under name column we have same name in more than one row. BUT if more than one name is suppose to be in the CSV report then the header (column names row) is again printed.
    so for example if i requested rpeort for two names A and B (reportNet uses same template which is executed twice) then report will look like this
    Name (header - column name)
    A
    A
    A
    A
    A
    Name (header - column name)
    B
    B
    B
    B
    I want to be able to remove the second header that comes before B starts.
    so i was thinking i would be able to access this excel sheet from java. and keep record of every row. If the row changes from A to B...i delete the previous row (which would end up being the second header).
    Can this be done thru java. I havnt before accessed excel sheets from java so any pointers would be greatly appreciated.

    Hi, well CSV is not currently an Excel file, it is a Comma Separated Values
    file which can be read through Excel.
    Now, if you wish to remove the header, I would purpose that you develop an
    application that reads the CSV file, as it is mere text, and that it also reads
    another file (lets call it confirguration.txt) in which you determine the pattern
    you want to remove, then you just read your report and if a string line
    matches the pattern you defined in the configuration.txt file, then you simply
    erase it.
    And if you keep interested in reading real Excel files (xls), I would
    recommend you use POI-HSSF API from Apache.org
    http://jakarta.apache.org/poi/hssf/index.html
    Hope this helps, cya around.

  • Accessing *.XLS from Java -- Help!

    Could anyone help me with some explanations about how to access MS Excel (*.elx) files from java?

    I just have Accessing Access from Java.
    /* 2003/02/06 eric.leung
    * Source : HOME
    import java.sql.*;
    import java.lang.*;
    public class ejdbcsel {
         public static void main(String args[]) {
              // eric_jsp is ODBC User DNS
              // String url = "jdbc:odbc:eric_jsp";     
              // Using DSNless connection
              String url = "";
              url = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)}" +
              ";SERVER=127.0.0.1;DBQ=c:\\example\\ERIC_JSP.mdb";
              Connection con;
              String query;
              query = "select * from pt_mstr";     
              Statement stmt;
         try {     
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         } catch (ClassNotFoundException e) {
              System.err.print("ClassNotFoundException " );
              System.err.println(e.getMessage());
         try {
              con = DriverManager.getConnection (url,"","");
              stmt = con.createStatement();
              ResultSet rec = stmt.executeQuery(query);          
              // Scan the Database
              while(rec.next()) {
                   System.out.println(rec.getString("pt_part") + "\t"
                   + rec.getString("pt_desc"));     
              stmt.close();
              con.close();
         } catch (SQLException ex) {
              System.err.println("SQLException: " + ex.getMessage());
         catch (Exception e) {
              System.err.println("Error: " + e.toString() + " " + e.getMessage());

  • Accessing NFS from Java

    I have requirement to create and write files on a NFS file storage. I need to do this from a Java application running on Windows 2008 Server.
    How do i implement this requirement?. Is there any Java Library to achieve this?.
    I have read documentation on WebNFS (Java Extended File System API). Where can i download this library?.
    WebNFS is renamed to YaNFS and made as open source (http://java.net/projects/yanfs). But YaNFS project doesn't appear to be active anymore.
    Thanks.

    809385 wrote:
    I have requirement to create and write files on a NFS file storageSo how would you do this outside of Java? Presumably you would mount the NFS on some Windows 2008 mount point (a quick Google search says this is not difficult). Why can't you do the same from Java (Process builder springs to mind) and then access the NFS using standard Java IO.

  • New bee - accessing CIS from java

    Hi ,
    On the same line. I want to access the CIS from Java. Can you guide me on how I can implement this . Both from a standalone java program and from a web layer ?
    I have installed content server 10gR3. I want to acess this server from Java.
    Any help is appreciated.

    I think that if you create a interface in java and a class in javafx that implements that interface you can then pass that class to java. For instance:
    Java:
    public interface EventReceiver {
        public void receive(String event);
    // Then your java class that generates the events
    public class EventGenerator {
        private List<EventReceiver> receivers = new LinkedList<EventReceiver>();
        public void registerEventReceiver(EventReceiver er) {
            receiver.add(er);
        public void unregisterEventReceiver(EventReceiver er) {
            receiver.remove(er);
         *  Add code that calls EventReceiver.receive(String) method for each element in the receiver list
         *  when the panel is touched.
    }and in the JavaFX code:
    public class JavaFXEventReceiver extends EventReceiver {
        public override function receive(String event) {
            // Do UI updates...
    }A little more indepth version can be found here:
    http://www.compare-review-information.com/pure-java-code-to-call-javafx-class/
    You might run into some problems though pertaining to threading...but there are workarounds for that aswell :)
    - Emil H

  • Maybe you are looking for