Java delete method?

Hi,
Does Java have a delete method similar to something like StrDelete(startindex, endindex)?? I want to open a file, find a word in a line and then delete the next five lines.
Many thanks.

I want to delete from the middle of a file (I have read the file into a temporary file, searched for a particular word and want to delete the next five lines). Alternatively I would like to say delete everything between "whatever" and "whatever2".
If a delete method only exists for a string then maybe I could read the file into a string though.
Any thoughts?
Thanks,
Aisling.

Similar Messages

  • Please Help Me, Delete Method(any suggestions!!)

    Can anyone spare the time to look at the below three classes and suggest a method that goes into the customerList class and deletes a record from the Oracle DB they are sitting on top of.
    For example when the deleteCust button is pressed on the form (customerForm) I would like it to delete the current customer (currentCustomer) that is displayed on the form at the time of the button click.
    Can anyone please HELP me, it would be very much appreciated :-)
    customer class
    import java.util.*;
    import java.sql.*;
    public class Customer{
    private int customer_id;
    private String customer_name;
    private String address1;
    private String address2;
    private String town;
    private String county;
    private String post_code;
    private String country;
    private String fax;
    private String telephone;
    private String contact_name;
    private String email;
    private boolean newCustomer;
    //private JobList jobList;
    public Customer(int c){
    customer_id = c;
    newCustomer = true;
    public Customer(int inCustomer_id,String inCustomer_name,String inAddress1, String inAddress2, String inTown, String inCounty,String inPost_code,String inCountry,String inFax,String inTelephone,String inContact_name,String inEmail){
    customer_id=inCustomer_id;
    customer_name=inCustomer_name;
    address1=inAddress1;
    address2=inAddress2;
    town=inTown;
    county=inCounty;
    post_code=inPost_code;
    country=inCountry;
    fax=inFax;
    telephone=inTelephone;
    contact_name=inContact_name;
    email=inEmail;
    newCustomer = false;
    public String getAddress1(){
    if (address1 == null)
    return ("");
    else
    return address1;
    public String getAddress2(){
    if (address2 == null)
    return ("");
    else
    return address2;
    public String getCounty(){
    if (county == null)
    return ("");
    else
    return county;
    public String getFax(){
    if (fax == null)
    return ("");
    else
    return fax;
    public int getCustomer_id(){
    if (customer_id == 0)
    return (0);
    else
    return customer_id;
    public String getCustomer_name(){
    if (customer_name == null)
    return ("");
    else
    return customer_name;
    public String getTelephone(){
    if (telephone == null)
    return ("");
    else
    return telephone;
    public String getPost_code(){
    if (post_code == null)
    return ("");
    else
    return post_code;
    public String getTown(){
    if (town == null)
    return ("");
    else
    return town;
    public String getCountry(){
    if (country == null)
    return ("");
    else
    return country;
    public String getContact_name(){
    if (contact_name == null)
    return ("");
    else
    return contact_name;
    public String getEmail(){
    if (email == null)
    return ("");
    else
    return email;
    /*public JobList getJobList() throws SQLException {
    // if the joblist object exists return it otherwise create it
    if (jobList != null){
    return jobList;
    else{
    return new JobList(this);
    public boolean isNewCustomer(){
    return newCustomer;
    public void setAddress1(String inAddress1){
    address1=inAddress1;
    public void setAddress2(String inAddress2){
    address2=inAddress2;
    public void setCounty(String inCounty){
    county=inCounty;
    public void setFax(String inFax){
    fax=inFax;
    public void setCustomer_id(int inCustomer_id){
    customer_id = inCustomer_id;
    public void setCustomer_name(String inCustomer_name){
    customer_name=inCustomer_name;
    public void setTelephone(String inTelephone){
    telephone=inTelephone;
    public void setPost_code(String inPost_code){
    post_code=inPost_code;
    public void setTown(String inTown){
    town=inTown;
    public void setCountry(String inCountry){
    country=inCountry;
    public void setContact_name(String inContact_name){
    contact_name=inContact_name;
    public void setEmail(String inEmail){
    email=inEmail;
    customerList class
    import java.sql.*;
    import java.util.*;
    public class CustomerList{
    private ResultSet rs ;
    private Connection con;
    private Statement stmt;
    public CustomerList () {
    ConnectionManager man = ConnectionManager.getInstance();
    con = man.getConnection();
    public Customer getFirstCustomer()throws SQLException {
    Customer firstCustomer;
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    rs = stmt.executeQuery("select customer_id,customer_name,address1,address2,town,county,post_code,country,fax,telephone,contact_name,email from customer");
    rs.next();
    firstCustomer = loadCustomer();
    return firstCustomer;
    public Customer getLastCustomer() throws SQLException{
    Customer lastCustomer;
    rs.last();
    lastCustomer = loadCustomer();
    return lastCustomer;
    public Customer getNextCustomer()throws SQLException{
    Customer nextCustomer ;
    if (rs.next()){
    nextCustomer = loadCustomer();
    else{
    nextCustomer = null;
    return nextCustomer;
    public Customer getPreviousCustomer()throws SQLException{
    Customer previousCustomer;
    if (rs.previous()){
    previousCustomer = loadCustomer();
    else
    previousCustomer = null;
    return previousCustomer;
    public Customer findCustomer(int inCustNum) throws SQLException{
    Customer foundCust;
    if (inCustNum==0){
    foundCust = getFirstCustomer();
    else{
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    rs = stmt.executeQuery("select customer_id,customer_name,address1,address2,town,county,post_code,country,fax,telephone,contact_name,email from customer where customer_id = "+inCustNum);
    if (rs.next()){
    foundCust = loadCustomer();
    else
    foundCust = null;
    return foundCust;
    public Customer addCust()throws SQLException{
    Statement stmt2 = con.createStatement();
    ResultSet rsadd = stmt2.executeQuery("select custid.nextval from dual");
    rsadd.next();
    int id = rsadd.getInt("nextval");
    rsadd.close();
    stmt2.close();
    Customer newCust = new Customer(id);
    return newCust;
    public Customer saveCustomer(Customer inSaveCust)throws SQLException{
    Statement stmt3 = con.createStatement();
    int rowNum;
    //int incid = inSaveCust.getCid();
    if (inSaveCust.isNewCustomer()){
    stmt3.executeUpdate("insert into customer values ("
    +inSaveCust.getCustomer_id()
    +",'"+inSaveCust.getCustomer_name()
    +"','"+inSaveCust.getAddress1()
    +"','"+inSaveCust.getAddress2()
    +"','"+ inSaveCust.getTown()
    +"','"+ inSaveCust.getCounty()
    +"','"+inSaveCust.getPost_code()
    +"','"+inSaveCust.getCountry()
    +"','"+inSaveCust.getFax()
    +"','"+ inSaveCust.getTelephone()
    +"','"+inSaveCust.getContact_name()
    +"','"+inSaveCust.getEmail()+"')");
    inSaveCust = getFirstCustomer();//refreshes list after insert
    inSaveCust = getLastCustomer();// goes to the inserted record ie last one
    else {
    rowNum = rs.getRow();//traps the record number so can be returned to
    stmt3.executeUpdate("update customer set customer_name = '"+inSaveCust.getCustomer_name()
    + "', address1 = '"+inSaveCust.getAddress1()
    + "', address2 = '"+inSaveCust.getAddress2()
    + "', town = '"+ inSaveCust.getTown()
    + "', county = '"+ inSaveCust.getCounty()
    + "', post_code = '"+inSaveCust.getPost_code()
    + "', telephone = '"+inSaveCust.getCountry()
    + "', fax = '"+inSaveCust.getFax()
    + "', country = '"+inSaveCust.getTelephone()
    + "', contact_name = '"+inSaveCust.getContact_name()
    + "', email = '"+inSaveCust.getEmail()
    +"' where customer_id = "+inSaveCust.getCustomer_id());
    inSaveCust = getFirstCustomer();
    rs.absolute(rowNum); // points back to same record number as updated
    inSaveCust = loadCustomer();
    con.commit();
    return inSaveCust;
    //Trying to add in the delete method here(as u can see it is not working)
    /*public Customer deleteCustomer() throws SQL Exception {
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    rs = stmt4.executeQuery("delete from customer where customer_id = "Integer.parseInt(textCustomer_id.getText()));
    rs.next();
    firstCustomer = loadCustomer();
    return firstCustomer;
    public boolean isFirst() throws SQLException{
    return rs.isFirst();
    public boolean isLast() throws SQLException{
    return rs.isLast();
    public Customer loadCustomer ()throws SQLException{
    Customer cust = new Customer(rs.getInt("customer_id"),rs.getString("customer_name"),rs.getString("address1"),
    rs.getString("address2"),rs.getString("town"),rs.getString("county"),
    rs.getString("post_code"),rs.getString("country"),rs.getString("fax"),
    rs.getString("telephone"),rs.getString("contact_name"),rs.getString("email"));
    return cust;
    customerForm class
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    public class CustomerForm extends JFrame implements ActionListener {
    private Customer currentCustomer;
    private CustomerList inCustomerList;
    private JPanel panel;
    private JTextField textCustomer_id,textCustomer_name,textAddress1,textAddress2,textTown,
    textCounty,textPost_code,textCountry,textTelephone,textFax,textContact_name,textEmail,textFind;
    private JButton nextCust, prevCust,firstCust,lastCust,newCust,
    findCust,add,save,delete,jobs,close,deleteCust;
    public CustomerForm(CustomerList inC)throws SQLException{
    inCustomerList = inC;
    currentCustomer = inCustomerList.getFirstCustomer();
    displayForm();
    displayFields();
    setTextFields();
    displayButtons();
    getContentPane().add(panel);
    setVisible(true);
    public void displayForm() throws SQLException{
    setTitle("Customer Form");
    setSize(700,500);
    // Center the frame
    Dimension dim = getToolkit().getScreenSize();
    setLocation(dim.width/2-getWidth()/2, dim.height/2-getHeight()/2);
    getContentPane().setLayout(new BorderLayout());
    Border etched = BorderFactory.createEtchedBorder();
    panel = new JPanel();
    panel.setLayout( null );
    Border paneltitled = BorderFactory.createTitledBorder(etched,"");
    panel.setBorder(paneltitled);
    panel.setBackground(new Color(224,224,255));
    public void displayFields() throws SQLException{
    int x = 10;
    int y = 50;
    int textheight = 20;
    int textwidth = 150;
    int labelwidth = 110;
    int ydist = textheight + 10;
    int xdist = textwidth*2;
    JLabel labelCustomer_id = new JLabel("Customer Number:");
    labelCustomer_id.setBounds( x, y, labelwidth, textheight);
    panel.add(labelCustomer_id);
    JLabel labelCustomer_name = new JLabel("Customer Name:");
    labelCustomer_name.setBounds(xdist, y, labelwidth, textheight);
    panel.add(labelCustomer_name);
    JLabel labelAddress1 = new JLabel("Address 1:");
    labelAddress1.setBounds( x, y+ydist, labelwidth, textheight);
    panel.add(labelAddress1);
    JLabel labelAddress2 = new JLabel("Address 2:");
    labelAddress2.setBounds( xdist, y+ydist, labelwidth, textheight);
    panel.add(labelAddress2);
    JLabel labelTown = new JLabel("Town:");
    labelTown.setBounds(x, y+ydist*2, labelwidth, textheight);
    panel.add(labelTown);
    JLabel labelCounty = new JLabel("County:");
    labelCounty.setBounds(xdist, y+ydist*2, labelwidth, textheight);
    panel.add(labelCounty);
    JLabel labelPost_code = new JLabel("Post Code:");
    labelPost_code.setBounds(x, y+ydist*3, labelwidth, textheight);
    panel.add(labelPost_code);
    JLabel labelCountry = new JLabel("Country:");
    labelCountry.setBounds(xdist, y+ydist*3, labelwidth, textheight);
    panel.add(labelCountry);
    JLabel labelTelephone = new JLabel("Phone:");
    labelTelephone.setBounds(x, y+ydist*4, labelwidth, textheight);
    panel.add(labelTelephone);
    JLabel labelFax = new JLabel("Fax:");
    labelFax.setBounds(xdist, y+ydist*4, labelwidth, textheight);
    panel.add(labelFax);
    JLabel labelContact_name = new JLabel("Contact Name:");
    labelContact_name.setBounds(x, y+ydist*5, labelwidth, textheight);
    panel.add(labelContact_name);
    JLabel labelEmail = new JLabel("E-mail address:");
    labelEmail.setBounds(xdist, y+ydist*5, labelwidth, textheight);
    panel.add(labelEmail);
    JLabel labelFind = new JLabel("Customer Number Search:");
    labelFind.setBounds( 40, 360, 200, textheight);
    panel.add(labelFind);
    textAddress1 = new JTextField();
    textAddress1.setBounds(x+labelwidth, y+ydist, textwidth, textheight);
    panel.add(textAddress1);
    textAddress2 = new JTextField();
    textAddress2.setBounds(xdist+labelwidth, y+ydist, textwidth, textheight);
    panel.add(textAddress2);
    textTown = new JTextField();
    textTown.setBounds(x+labelwidth, y+ydist*2, textwidth, textheight);
    panel.add(textTown);
    textCounty = new JTextField();
    textCounty.setBounds(xdist+labelwidth, y+ydist*2, textwidth, textheight);
    panel.add(textCounty);
    textPost_code = new JTextField();
    textPost_code.setBounds(x+labelwidth, y+ydist*3, textwidth, textheight);
    panel.add(textPost_code);
    textCountry = new JTextField();
    textCountry.setBounds(xdist+labelwidth, y+ydist*3, textwidth, textheight);
    panel.add(textCountry);
    textTelephone = new JTextField();
    textTelephone.setBounds(x+labelwidth, y+ydist*4, textwidth, textheight);
    panel.add(textTelephone);
    textFax = new JTextField();
    textFax.setBounds(xdist+labelwidth, y+ydist*4, textwidth, textheight);
    panel.add(textFax);
    textContact_name = new JTextField();
    textContact_name.setBounds(x+labelwidth, y+ydist*5, textwidth, textheight);
    panel.add(textContact_name);
    textEmail = new JTextField();
    textEmail.setBounds(xdist+labelwidth, y+ydist*5, textwidth+50, textheight);
    panel.add(textEmail);
    textFind = new JTextField();
    textFind.setBounds(200, 360, 80, textheight);
    panel.add(textFind);
    textCustomer_id = new JTextField();
    textCustomer_id.setBounds(x+labelwidth, y, textwidth, textheight);
    panel.add(textCustomer_id);
    textCustomer_name = new JTextField();
    textCustomer_name.setBounds(xdist+labelwidth, y, textwidth+50, textheight);
    panel.add(textCustomer_name);
    public boolean delete() {
    textCustomer_id.setText("");
    textCustomer_name.setText("");
    textAddress1.setText("");
    textAddress2.setText("");
    textTown.setText("");
    textCounty.setText("");
    textPost_code.setText("");
    textCountry.setText("");
    textTelephone.setText("");
    textFax.setText("");
    textContact_name.setText("");
    textEmail.setText("");
    textFind.setText("");
    return true;
    public void displayButtons(){
    firstCust= new JButton("FIRST");
    firstCust.addActionListener(this);
    firstCust.setBounds(50, 430, 100, 20 );
    panel.add( firstCust );
    nextCust = new JButton("NEXT");
    nextCust.addActionListener(this);
    nextCust.setBounds(150, 430, 100, 20 );
    panel.add( nextCust );
    prevCust = new JButton("PREVIOUS");
    prevCust.addActionListener(this);
    prevCust.setBounds(250, 430, 100, 20 );
    panel.add( prevCust );
    lastCust= new JButton("LAST");
    lastCust.addActionListener(this);
    lastCust.setBounds(350, 430, 100, 20 );
    panel.add( lastCust );
    findCust= new JButton("FIND");
    findCust.addActionListener(this);
    findCust.setBounds(350, 360, 100, 20 );
    panel.add( findCust );
    add = new JButton("ADD");
    add.addActionListener(this);
    add.setBounds(150, 400, 100, 20 );
    panel.add( add );
    save = new JButton("SAVE");
    save.addActionListener(this);
    save.setBounds(250, 400, 100, 20 );
    panel.add( save );
    jobs = new JButton("JOBS");
    jobs.addActionListener(this);
    jobs.setBounds(550, 360, 100, 20 );
    panel.add( jobs );
    close = new JButton("CLOSE");
    close.addActionListener(this);
    close.setBounds(550, 430, 100, 20 );
    panel.add( close );
    delete = new JButton("DELETE");
    delete.addActionListener(this);
    delete.setBounds(350, 400, 100, 20 );
    panel.add( delete );
    deleteCust = new JButton("DELETECUST");
    deleteCust.addActionListener(this);
    deleteCust.setBounds(450, 400, 100, 20);
    panel.add( deleteCust );
    public void getTextFields(){
    currentCustomer.setCustomer_id(Integer.parseInt(textCustomer_id.getText()));
    currentCustomer.setCustomer_name(textCustomer_name.getText());
    currentCustomer.setAddress1(textAddress1.getText());
    currentCustomer.setAddress2(textAddress2.getText());
    currentCustomer.setTown(textTown.getText());
    currentCustomer.setCounty(textCounty.getText());
    currentCustomer.setPost_code(textPost_code.getText());
    currentCustomer.setCountry(textCountry.getText());
    currentCustomer.setFax(textFax.getText());
    currentCustomer.setTelephone(textTelephone.getText());
    currentCustomer.setContact_name(textContact_name.getText());
    currentCustomer.setEmail(textEmail.getText());
    public void setTextFields() throws SQLException{
    textCustomer_id.setText(String.valueOf(currentCustomer.getCustomer_id()));
    textCustomer_id.setEditable(false);
    textCustomer_name.setText(currentCustomer.getCustomer_name());
    textAddress1.setText(currentCustomer.getAddress1());
    textAddress2.setText(currentCustomer.getAddress2());
    textTown.setText(currentCustomer.getTown());
    textCounty.setText(currentCustomer.getCounty());
    textPost_code.setText(currentCustomer.getPost_code());
    textCountry.setText(currentCustomer.getCountry());
    textFax.setText(currentCustomer.getFax());
    textTelephone.setText(currentCustomer.getTelephone());
    textContact_name.setText(currentCustomer.getContact_name());
    textEmail.setText(currentCustomer.getEmail());
    public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();
    try {
    if (source == nextCust)
    currentCustomer = inCustomerList.getNextCustomer();
    else if (source == prevCust)
    currentCustomer = inCustomerList.getPreviousCustomer();
    else if (source == findCust) {
    try {
    currentCustomer =
    inCustomerList.findCustomer(Integer.parseInt(textFind.getText()));
    catch (NumberFormatException ex) {
    JOptionPane.showMessageDialog(
    null, "Invalid Customer number", "ERROR",
    JOptionPane.ERROR_MESSAGE);
    if (currentCustomer == null) {
    JOptionPane.showMessageDialog(null, "Customer not found");
    currentCustomer = inCustomerList.getFirstCustomer();
    textFind.setText(null);
    else if (source == firstCust)
    currentCustomer = inCustomerList.getFirstCustomer();
    else if (source == lastCust)
    currentCustomer = inCustomerList.getLastCustomer();
    else if (source == add) {
    currentCustomer = inCustomerList.addCust();
    add.setEnabled(false);
    else if (source == delete) {
    delete();
    else if (source == save) {
    add.setEnabled(true);
    getTextFields();
    currentCustomer = inCustomerList.saveCustomer(currentCustomer);
    //else if (source == jobs) {
    // JFrame newJobForm = new JobForm(currentCustomer.getJobList());
    //else if (source == deleteCust) {
    //........... //currentCustomer = inCustomerList.deleteCustomer(currentCustomer);
    else if (source == close) {
    dispose();
    setTextFields();
    nextCust.setEnabled(!inCustomerList.isLast());
    prevCust.setEnabled(!inCustomerList.isFirst());
    firstCust.setEnabled(!inCustomerList.isFirst());
    lastCust.setEnabled(!inCustomerList.isLast());
    catch (SQLException ex) {
    System.out.println("Failed");
    System.out.println(ex.getMessage());
    ex.printStackTrace();
    System.exit(-1);
    PLEASE HELP ME!!!

    http://www.ss64.demon.co.uk/orasyntax/

  • Hot code replace failed - Delete method not implemented

    I debug my Java application with Eclipse (3.1). When I change my code during debugging, I get the following error message:
    ...MyApp at localhost:4540 (may be out of synch) was unable to replace the running code with the code in the workspace.
    Reason:
    Hot code replace failed - Delete method not implemented
    What does that mean and how can I fix this?

    This means you changed a class while it was debugging an application and it could not update the class for the application while it was running.
    The error suggests you may be running an older JVM, i.e. pre-1.4.2 but this error can occur with any JVM if the change is incompatible with the previous version of the class.
    The hot replace often does not work for non trivial changes to code.

  • Ask about DELETE method of HTTPService

    Dear all,
    I am developing an application to connect to a Photo Web
    Storage on the internet.
    and I have delete function to delete a photo.
    but when I use a HTTPService (using method DELETE) to send a
    delete request,
    it always return an object (that is the photo I want to
    delete).
    I think that the HTTPService automatically ridirect the
    DELETE function to GET function.
    so the request brings up the photo
    I have a check the Java Client Library, and i realize that
    this library has set the strictPostRedirect
    to true to prevent the convert from DELETE to GET
    So my question is: AS3 have a similar properties as
    strictPostRedirect?
    Thank you for help
    DatTV

    Hi all,
    I just find out the reason:
    Flash Player does not support HTTP PUT and HTTP DELETE method
    you can refer to the following for more:
    http://www.nabble.com/httpservice-method-3D-22DELETE-22-does-not-work-to7165236.html

  • Invoking remote java classes/methods

    Hi,
    I just wanted to ask for opinions and suggestions regarding my attempt to call a remote java class method using PL/SQL. I didn't want to load it in the database since the configurations for the java class were already set using Spring Integration. I just wanted to supply constructor arguments and run the method and then retrieve the result. Are there any good or easier ways on doing this?
    Thanks in advance

    Very curious Susan,
    A server JVM might not want to host mobile code from other clients, not that it's unsafe, it's just that it allows clients to crash the server JVM at will. They should have it configured to automatically restart though.
    Did they delete the java.rmi.* packages from the server JVM runtime? I don't understand why they'd do that.
    If you can pry some reasons from them, I'd be very interested to hear them. Perhaps they just want more money, in order to allow you this privilige.
    John
    PS I've updated representation for you, and ejp, on the cajo project supporting The Land Down Under!

  • Calling a java static method from javascript

    I am running into issue while calling a java static method with a parameter from javascript. I am getting the following error. Any help is greatly appreciated.
    Thx
    An error occurred at line: 103 in the jsp file: /jnlpLaunch.jsp
    pfProjectId cannot be resolved to a variable
    =================================================
    // Java static method with one parameter
    <%!
    public static void CreateJnlpFile(String pfProjectId)
    %>
    //Script that calls java static method
    <script language="javascript" type="text/javascript">
    var pfProjectId = "proj1057";
    // Here I am calling java method
    <%CreateJnlpFile(pfProjectId);%>
    </script>
    ===================================================
    Edited by: 878645 on Mar 6, 2012 11:30 PM

    Thanks, Got what you are telling. Right now I have one jsp file which is setting the parameter 'pfProjectId' and in another .jsp I am retrieving it. But I am getting null valuue
    for the variable. I am wondering why I am getting null value in the second jsp page?.
    Thx
    ====================================================================
    <script language="javascript" type="text/javascript">
    // Setting parameter pfProjectId
    var pfProjectId = "proj1057";
    request.setParameter("pfProjectId", "pfProjectId");
    </script>
    // Using Button post to call a .jsp that creates jnlp file
    <form method=post action="CreateJnlpFile.jsp">
    <input type="submit" value="Create JNLP File">
    </form>
    //Contents of second .jsp file CreateJNLPFile.jsp
    String pfProjectId = request.getParameter("pfProjectId ");
    System.out.println( "In CreateJnlpFile.jsp pfProjectId " + pfProjectId );
    =======================================================

  • How to generate all the links of the java api methods

    Hi all,
    I noticed from my docs that the JAVA API methods are not linked. They are just static text. How can i link all the java api methods to a root url examble: java.sun.com/j2se/docs/javax/JFrame#pack()
    java.sun.com/j2se/docs/javax/JFrame#setVisible()
    java.sun.com/j2se/docs/java/sql/ResultSet#executeQuery()
    and so on.
    Thank you in advance.

    It sounds like you'd like to link to our docs on java.sun.com.
    You can do this using -link or -linkoffline
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#link
    Start by reading the section "Choosing between -linkoffline and -link"
    Basically, try this option first:
    -link http://java.sun.com/j2se/1.4/docs/api
    If this fails (because your shell cannot access java.sun.com),
    then copy package-list from java.sun.com to your current directory,
    then use this option:
    -linkoffline http://java.sun.com/j2se/1.4/docs/api .
    Notice that the second argument is a dot "." to indicate
    that package-list is in the current directory.
    -Doug Kramer
    Javadoc team

  • How to write javascript in java class method

    Hi,
    any one please resolved this,
    i want to write javascript window closing code into java class method, in that method i want to write javascript code & wanted to call in jsf page on commandButton action event,
    my code is below but it is not working properly
    public void closeWindowClicked(ActionEvent event) {
              try
         FacesContext facesContext = FacesContext.getCurrentInstance();
         String javaScriptText = "window.close();";
         // Add the Javascript to the rendered page's header for immediate execution
         AddResource addResource = AddResourceFactory.getInstance(facesContext);
         addResource.addInlineScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, javaScriptText);
    catch(Exception e)
         System.out.println(""+e);
    for calling into jsf code is below
    <h:commandButton action="#{parentBean.closeWindowClicked}" value="OK" />
    /*Note- i want to closed the window by caling method contain javascript only, i don't want any ajax code in method */
    please any one can resolved this.
    Thanks

    /*Note- i want to closed the window by caling method contain javascript only, i
    don't want any ajax code in method */ When the user presses your button, do your business logic and then send them to a page containing the following (note: untested code ahead):
    <html>
    <head>
        function onLoadHandler()
            window.close();
    </head>
    <body onload="onLoadHandler();">
        <p>Window closing....</p>
    </body>
    </html>

  • Setting Control-Flow- Case on java class/method

    hello All :D
    i have little problem about control flow case, in my case i've 2 page where before load to the page i'wanna make condition (if-else)
    when the user choose the field, the java class get the value for make true condition. In this case, i wanna implement ControlFlowCase in java class/method, so anyone help..?
    thx
    agungdmt

    Have you considered using router activity - http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/taskflows_activities.htm#CJHFFGAF ?

  • Java application hangs during running java native method

    Hello,
    There is compiled java application.
    It hangs at very begginings.
    It was detected that in the beggining a new Frame should be created. Then one java library invokes native method. During invoking of the native method application hangs.
    Stack is available only until native method invocation.
    Thread 25196 "main": (state = IN_NATIVE)
    at sun.awt.X11GraphicsDevice.getDoubleBufferVisuals(Native Method)
    at sun.awt.X11GraphicsDevice.getDefaultConfiguration(X11GraphicsDevice.java:181)
    at java.awt.Window.init(Window.java:271)
    at java.awt.Window.<init>(Window.java:319)
    at java.awt.Frame.<init>(Frame.java:419)
    at javax.swing.JFrame.<init>(JFrame.java:194)
    at com.test.ORBManager.Splash.<init>(Splash.java:10)
    at com.test.ORBManager.Splash.main(Splash.java:48)
    Method getDoubleBufferVisuals(int screen) is used to enumerates all visuals that support double buffering (according to comments in the source code).
    Tried to run with "-verbose" options...
    I tried to use jconsole &#1080; jvisualvm. But did not find anything special.
    Also "strace" command showed some results but do not know how to proceed:
    select(6, [5], [5], NULL, NULL) = 1 (out [5])
    writev(5, [{"b\0\6\0\r\0\0\0DOUBLE-BUFFER\0\0\0", 24}], 1) = 24
    select(6, [5], [], NULL, NULL) = 1 (in [5])
    read(5, "\1\0\t\0\0\0\0\0\1\211\0\204\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096) = 32
    read(5, 0x83b57bc, 4096) = -1 EAGAIN (Resource temporarily unavailable)
    gettimeofday({1275494877, 569746}, NULL) = 0
    select(6, [5], [5], NULL, NULL) = 1 (out [5])
    writev(5, [{"b\0\6\0\r\0\0\0DOUBLE-BUFFER\0\0\0", 24}], 1) = 24
    select(6, [5], [], NULL, NULL) = 1 (in [5])
    read(5, "\1\0\n\0\0\0\0\0\1\211\0\204\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096) = 32
    read(5, 0x83b57bc, 4096) = -1 EAGAIN (Resource temporarily unavailable)
    select(6, [5], [5], NULL, NULL) = 1 (out [5])
    writev(5, [{"\211\6\3\0\1\0\0\0&\0\0\0", 12}], 1) = 12
    select(6, [5], [], NULL, NULL) = 1 (in [5])
    read(5, "\1\0\v\0\f\0\0\0\1\0\0\0\377\32\0\0\377\r\307 \0\0\0\0\0\23\372\300\376\3346\34"..., 4096) = 44
    read(5, 0x83c31e4, 36) = -1 EAGAIN (Resource temporarily unavailable)
    select(6, [5], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
    I have downloaded from the internet the source code of native method but do not know what I can do with it.
    Is it possible to debug native method somehow?
    How to detect where the library contans the native method is located?
    What other ways can provide more information about reason.
    It seems that the problem is related to graphics. Judging by class name "X11GraphicsDevice" it is related to X server. May be some server settings?
    The problem is present on SLED 11 machines.
    It is not reproduced on SLED 10.
    I will be really appreciate for any help.
    Thanks in advance.
    Vasily.

    Hi,
    Thanks for tip. I used jstack. It gives a little bit more info but I have to few knoledges how to treat the info.
    ----------------- 24231 -----------------
    ----------------- 24317 -----------------
    0xffffe430     ????????
    0x6dd12229     ????????
    0xb0ca5898     * java.net.PlainSocketImpl.socketAccept(java.net.SocketImpl) bci:0 (Interpreted frame)
    0xb0c9fb6b     * java.net.PlainSocketImpl.accept(java.net.SocketImpl) bci:7 line:384 (Interpreted frame)
    0xb0c9fb6b     * java.net.ServerSocket.implAccept(java.net.Socket) bci:50 line:450 (Interpreted frame)
    0xb0c9fb6b     * java.net.ServerSocket.accept() bci:48 line:421 (Interpreted frame)
    0xb0c9fa94     * sun.rmi.transport.tcp.TCPTransport.run() bci:59 line:340 (Interpreted frame)
    0xb0c9fe71     * java.lang.Thread.run() bci:11 line:595 (Interpreted frame)
    0xb0c9d236     <StubRoutines>
    0xb6f38eac     _ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread + 0x1bc
    0xb7108aa8     _ZN2os20os_exception_wrapperEPFvP9JavaValueP12methodHandleP17JavaCallArgumentsP6ThreadES1_S3_S5_S7_ + 0x18
    0xb6f38705     _ZN9JavaCalls12call_virtualEP9JavaValue11KlassHandle12symbolHandleS3_P17JavaCallArgumentsP6Thread + 0xd5
    0xb6f3879e     _ZN9JavaCalls12call_virtualEP9JavaValue6Handle11KlassHandle12symbolHandleS4_P6Thread + 0x5e
    0xb6fb0765     _Z12thread_entryP10JavaThreadP6Thread + 0xb5
    0xb71a9373     _ZN10JavaThread3runEv + 0x133
    0xb71096b8     _Z6_startP6Thread + 0x178
    0xb781a1b5     start_thread + 0xc5
    ----------------- 24318 -----------------
    0xffffe430     ????????
    0x1b7bfaf0     ????????
    ----------------- 24373 -----------------
    0xffffe430     ????????
    0xb71087be     _ZN2os5Linux14safe_cond_waitEP14pthread_cond_tP15pthread_mutex_t + 0xae
    0xb70fe2af     _ZN13ObjectMonitor4waitExiP6Thread + 0xa6f
    0xb718bdc6     _ZN18ObjectSynchronizer4waitE6HandlexP6Thread + 0x56
    0xb6f925e3     JVM_MonitorWait + 0x163
    0xb0ca5898     * java.lang.Object.wait(long) bci:0 (Interpreted frame)
    0xb0c9fb6b     * java.lang.ref.ReferenceQueue.remove(long) bci:44 line:120 (Interpreted frame)
    0xb0c9fa94     * java.lang.ref.ReferenceQueue.remove() bci:2 line:136 (Interpreted frame)
    0xb0c9fa94     * sun.java2d.Disposer.run() bci:3 line:125 (Interpreted frame)
    0xb0c9fe71     * java.lang.Thread.run() bci:11 line:595 (Interpreted frame)
    0xb0c9d236     <StubRoutines>
    0xb6f38eac     _ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread + 0x1bc
    0xb7108aa8     _ZN2os20os_exception_wrapperEPFvP9JavaValueP12methodHandleP17JavaCallArgumentsP6ThreadES1_S3_S5_S7_ + 0x18
    0xb6f38705     _ZN9JavaCalls12call_virtualEP9JavaValue11KlassHandle12symbolHandleS3_P17JavaCallArgumentsP6Thread + 0xd5
    0xb6f3879e     _ZN9JavaCalls12call_virtualEP9JavaValue6Handle11KlassHandle12symbolHandleS4_P6Thread + 0x5e
    0xb6fb0765     _Z12thread_entryP10JavaThreadP6Thread + 0xb5
    0xb71a9373     _ZN10JavaThread3runEv + 0x133
    0xb71096b8     _Z6_startP6Thread + 0x178
    0xb781a1b5     start_thread + 0xc5
    ----------------- 24227 -----------------
    0xffffe430     ????????
    0x6cbc4021     ????????
    0x6cbc232a     ????????
    0x6cbc3c9a     ????????
    0x6cc1d5d1     ????????
    0x6d41013f     ????????
    0x6d460f19     ????????
    0xb0ca5898     * sun.awt.X11GraphicsDevice.getDoubleBufferVisuals(int) bci:0 (Interpreted frame)
    0xb0c9fb6b     * sun.awt.X11GraphicsDevice.getDefaultConfiguration() bci:140 line:181 (Interpreted frame)
    0xb0c9fa94     * java.awt.Window.init(java.awt.GraphicsConfiguration) bci:51 line:271 (Interpreted frame)
    0xb0c9fb6b     * java.awt.Window.<init>() bci:66 line:319 (Interpreted frame)
    0xb0c9fb6b     * java.awt.Frame.<init>(java.lang.String) bci:1 line:419 (Interpreted frame)
    0xb0c9fb6b     * javax.swing.JFrame.<init>(java.lang.String) bci:2 line:194 (Interpreted frame)
    0xb0c9fb6b     * com.test.ORBManager.Splash.<init>() bci:3 line:10 (Interpreted frame)
    0xb0c9fb6b     * com.test.ORBManager.Splash.<init>(java.lang.String[]) bci:4 line:48 (Interpreted frame)
    0xb0c9d236     <StubRoutines>
    0xb6f38eac     _ZN9JavaCalls11call_helperEP9JavaValueP12methodHandleP17JavaCallArgumentsP6Thread + 0x1bc
    0xb7108aa8     _ZN2os20os_exception_wrapperEPFvP9JavaValueP12methodHandleP17JavaCallArgumentsP6ThreadES1_S3_S5_S7_ + 0x18
    0xb6f38cdf     _ZN9JavaCalls4callEP9JavaValue12methodHandleP17JavaCallArgumentsP6Thread + 0x2f
    0xb6f638b2     _Z17jni_invoke_staticP7JNIEnv_P9JavaValueP8_jobject11JNICallTypeP10_jmethodIDP18JNI_ArgumentPusherP6Thread + 0x152
    0xb6f54ac2     jni_CallStaticVoidMethod + 0x122
    0x08049873     ????????
    0xb76c9705     ????????The last stack also has "sun.awt.X11GraphicsDevice.getDoubleBufferVisuals(int) bci:0 (Interpreted frame)" but what tode next?
    Also I found that the native code is in java 1.5 source code: \j2se\src\solaris\native\sun\awt\awt_GraphicsEnv.c.
    How it is possible to compile it?

  • How to disable PUT/DELETE method in SMC tomcat

    Hi,
    SMC provides tomcat as the web server to allow logon the SMC console through IE.
    For security consideration, we have to disable the http "PUT" and "DELETE" method of tomcat. Its config file seems to be /opt/SUNWsymon/web/conf/catalina.policy, but I have no knowledge of this file.
    Do anyone know how to disable PUT/DELETE method in tomcat? Or provide me a reference book for this issue?
    Thanks a lot.

    For security consideration, we have to disable the
    http "PUT" and "DELETE" method of tomcat. Its config
    file seems to be
    /opt/SUNWsymon/web/conf/catalina.policy, but I have
    no knowledge of this file.I'm not sure how to disable that feature, but be aware if you disable the ability for Agents to send files to the SunMC web server you may break all Configuration Tasks. Agent config files are sent to the Server by HTTP to allow them to be stored as templates/snapshots.
    I don't remember seeing instructions on how to make the changes you want: the quickest way to find out is probably to call SunMC support.
    Regards,
    [email protected]

  • [svn:bz-trunk] 7494: Add testcaseses for http put and delete methods.

    Revision: 7494
    Author:   [email protected]
    Date:     2009-06-02 13:13:33 -0700 (Tue, 02 Jun 2009)
    Log Message:
    Add testcaseses for http put and delete methods. Proxy should return endpoint's content instead of empty body
    Added Paths:
        blazeds/trunk/qa/apps/qa-regress/remote/testMethods.jsp
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/proxyService/httpservice/bugs/Pu tAndDeleteMethodTests.mxml

    found it - here: http://discussions.apple.com/thread.jspa?threadID=2323131&tstart=30
    I set the Realm to Location instead of Folder. Now I'm prompted for my credentials at the /svn/ URL.

  • ADF: Can i call javascript function from java clsss method in ADF?

    Hi,
    I want to call javascript function in Java class method, is it possible in ADF? , if yes then how?
    or I need to use Java 6 feature directely?
    Regards,
    Deepak

    private void writeJavaScriptToClient(String script)
    FacesContext fctx = FacesContext.getCurrentInstance();
    ExtendedRenderKitService erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
    erks.addScript(fctx, script);
    }usage
    StringBuilder script = new StringBuilder();
    script.append( "var popup = AdfPage.PAGE.findComponentByAbsoluteId('p1');");
    script.append("if(popup != null){"); script.append("popup.show();"); script.append("}");
    writeJavaScriptToClient(script.toString());Timo

  • HttpService Put and Delete methods support

    Hello,
    HttpService doesn't seem to be supporting PUT and DELETE methods. The trick of using "X-HTTP-Method-Override" did send the request as PUT/DELETE request. But the server side code is unable to detect it as PUT/DELETE request. The server side code is in PHP and uses FuelPHP Framework. 
    Can anyone please suggest a way by which the request can be sent as PUT/DELETE such that it can be identified as same PUT/Delete request.
    Thanks

    Q 1 and 2 : http://blogs.sun.com/meena/entry/disabling_trace_in_sun_java
    About Q 3 ciphers which version of WebServer are you using?

  • HTTP delete method handling / enabling??

    Hi, I am a newbie to the WL world and wondering if there is any setup/config required on the weblogic server to enable the handling of HTTP DETELE method or does it all control/manage by the application? I understand web servers like Apache requires specific setup/scripts to handle the DELETE method. What about WebLogic Srvr?

    To enable delete, there must be "modify"permission
    given to the user account who has access to web
    application. By default "IUSR_machinename" windows
    account has anonymous access to web application in
    IIS. You must have to give "modify" permission to
    this acccount on the web application folder.
    That's it !!!!! You are ready to send HTTP DELETE
    requestsUmmmmmm. This seems a greatly dangerous and stupid
    solution!I mean this topic is completely out of scope for this forum and I know not a whole lot about IIS but it seems to me you just set it up so anyone can delete files from your website.
    Did you really want to do that?

Maybe you are looking for

  • Problems of MacPro 2010 Mixing 2gb & 1gb memory together

    Actually my MacPro 2010 12-core was running 8x1gb sticks before. I just got 4 of 2gb sticks memory from a friend today. And I do have problem mixing them with the original 1gb sticks. Only plug 2gb sticks in Slot 1,2,5,6 - No Problem When I have 2 x

  • IPhone 4 on 4.3.3 photos will not sync?

    I've never had a problem syncing my photos until just recently. I don't know if the problem is due to 4.3.3 or not. ITunes is not recognizing the folders I've selected to sync at all (I can tell because it is not allocating any disk space to my photo

  • DirSync doesn't work

    Hi, i try to implement test network with Office 365 and AD Domain on-premise. Have created federated trust, it seems works: PS C:\> Get-MsolFederationProperty -DomainName testdomain.maildomain.org Source : ADFS Server ActiveClientSignInUrl : https://

  • Re: Lumia 520 - Opening a video sent from WhatsApp...

    My Lumia 520 takes at least 10 mnts to open up a video sent via WhatsApp. It is too long. I got dis phone via flipkart. Photo uploading to my profile in many sites wil not happen. Occasionally it uploads. What is the solution? (Someone said me phone

  • ISE web portal problem

    Dear Friends, I configured my 5508(in sso) and i made authentication through 802.1x on our software ISE,  i spent time to enable WEB portal authentication for guest users(guest wlan), so many guides for web portal authentication, my ACL on WLC shows