47pirates 9

from where can ni disable the filtering?

47pirates 9 Junior Poster in Training

I've client and server on my wireless LAN , I can easily ping from client to server any time n, similarly i can ping from server to client for one time and after the application is run. I cannot ping again to the client from server. Why this is happening please help

47pirates 9 Junior Poster in Training

I'm trying to give access to client computer from my server and also tryin to revoke the granted access... the grant is successful but the revoking is not working please help.
hms is the satabase that i want to give access to my clients..
my code

 try {

            Connection con = getDBConnection();
            Statement stmt = con.createStatement();
            if (sts == true) {
                String query = "GRANT INSERT,SELECT,UPDATE,DELETE ON hms.* TO '" + MainFrame.dbUser + "'@'" + ip + "' IDENTIFIED BY '" + MainFrame.dbPassword + "'";
                stmt.execute(query);
                System.out.println(query);
                JOptionPane.showMessageDialog(null, "Permission granted to '" + ip + "' !");
            }
            else{
                String query ="REVOKE INSERT,SELECT,UPDATE,DELETE on hms.* FROM '"+MainFrame.dbUser+"'@'"+ip+"' identified by '"+MainFrame.dbPassword+"';";
                stmt.execute(query);
                System.out.println(query);
                JOptionPane.showMessageDialog(null, "Permission denied for '" + ip + "' !");
            }

        } catch (Exception ex) {
            ex.printStackTrace();
            JOptionPane.showMessageDialog(null, "Failed");
        }

this is the error i get

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'howday'@'192.168.1.69' to database 'hms'

please help!!!

47pirates 9

thanx for all i solve the problem :) cheers

47pirates 9

on line 85 that break is to avoid the further prompt for the new PRDDayBook(i)...which wud have been called for everypossible value of i from the 1st loop.... I'm still stucked with the same problem i am still getting multiple copies of final pages...wud u please suggest me the alternative ways. Plzzz help

47pirates 9

I supposed to make that recursive call just to print the remaining data(line no. 84). Everthing is working fine.. i can get as many pages of data as i want to print out.. but the problem is that for multiple pages of data i'm getting their PRINT_OUT more than one time.
I tried to figure out the no. of copies of data in this pattern:

For 1 page data :page no 1 -> 1 time
For 2 page data :page no 1 -> 1 time page no 2 -> 2 times
For 3 page data :page no 1 -> 1 time page no 2 -> 2 times page no 3 -> 4 times

..................................................
this is how i am getting the printouts..how can i solve this problem plz help...

47pirates 9

that is a class which is called from another main class...i dun know how to show main class

47pirates 9

actually its a part of printing module... there is another main method in MainFrame class i don't know how to make it compilable for u

47pirates 9 Junior Poster in Training

Why the method of the following class is getting invoked several times even if the condition is false.Please help me with my code...

public class PRDDayBook {

    int remX;

    public PRDDayBook(int x) {
        remX = x;

        PrinterJob pj = PrinterJob.getPrinterJob();

        PageFormat pf = pj.defaultPage();
        Paper paper = new Paper();
        double margin = 9;
        paper.setImageableArea(margin, margin, paper.getWidth() - margin * 2, paper.getHeight() - margin * 2);
        pf.setPaper(paper);

        pj.setPrintable(new MyPrintable(), pf);
        if (pj.printDialog()) {
            try {
                pj.print();
            } catch (PrinterException e) {
                System.out.println(e);
            }
        }
    }

    class MyPrintable implements Printable {

        public int print(Graphics g, PageFormat pf, int pageIndex) {
            if (pageIndex != 0) {
                return NO_SUCH_PAGE;

            }

            int x = 100;
            int y = 50;

            Graphics2D g2 = (Graphics2D) g;
            g2.setFont(new Font("Serif", Font.PLAIN, 10));
            g2.setPaint(Color.black);

            g2.drawString("S.No", x, 30);
            g2.drawString("Date", x + 30, 30);
            g2.drawString("Particulars", x + 100, 30);
            g2.drawString("Amount Rs", x + 250, 30);
            g2.drawString("Voucher No", x + 300, 30);

            // for printing the items with teir rates and cost
            int hor = DayBookRecords.data.size();
            int ver = DayBookRecords.data.get(0).size();

            double ph = pf.getImageableHeight();
            double pw = pf.getImageableWidth();
            int m=0;

            System.out.println("HOR:" + hor + " VER " + ver);

            for (int i = remX + 1; i < hor; i++) {
                for (int j = 0; j < ver; j++) {

                    g2.drawString("" + DayBookRecords.data.get(i).get(j), x, y);

                    if (j == 0) {
                        x = x + 30;
                    }
                    if (j == 1) {
                        x = x + 70;
                    }
                    if (j == 2) {
                        x = x + 150;
                    }
                    if (j == 3 ...

47pirates 9

how can i solve my problem> plz help

47pirates 9 Junior Poster in Training

Hello guys i trying to manage the size of two jpanel according to the size of Main Jframe. I using netbeans drag and drop Jpanel1 is big and another one is small. wat i need to do is to change those panels size when main frame is resized> how can i do plz help. I tried borderLayout() but when i do this , my second panel is invisble. the whole panel is occupied by only fisrt panel. How can i do it in netbeans plz help

47pirates 9

yes, i'm usibg Mysql at the back end!!!

47pirates 9

actully i am trying to get a .exe or .msi file from my jar file.. so that it can be installed in other system as well

47pirates 9 Junior Poster in Training

How can i change my java program in netbeans(currently) so that i can install my program in any other computer?
Which is the currently best tool plzz help

47pirates 9 Junior Poster in Training

I want to store a Vector<Vector> in mysql database. What is the best data Tpye that i can use in mysql and java to store and retrieve the datas.

47pirates 9 Junior Poster in Training

In my desktop application whenever execute the code to backup my database from java application the app goes on waiting state may be for password , which we have to enter while backing up from command line. But i've provided the username and password of database in the code. Why is it going on waiting state. please help how can i do this. My execution code is:

  public boolean backupDB(String dbName, String dbUserName, String dbPassword) {

        Process runtimeProcess;
        try {

       runtimeProcess = Runtime.getRuntime().exec("C://xampp//mysql//bin//mysqldump -u"+ dbUserName+" -p "+dbPassword+" dbName+" > D://backup.sql");

            int processComplete = runtimeProcess.waitFor();

            if (processComplete == 0) {
                System.out.println("Backup created successfully");
                return true;
            } else {
                System.out.println("Could not create the backup");
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        return false;
    }

47pirates 9 Junior Poster in Training

I'm using Xampp for the database in my computer now what i want to do is to back up the database name "HMS" with "root" username and " " password. How can i do this in java please suggest.

47pirates 9 Junior Poster in Training

HOw can i convert the String "2012-07-30" to Date object with same format 2012-07-30 which is date not a string. I've tried but i get the result in string. plz help

47pirates 9

actually i don't need to draw those rectangles in page. Those boxes are already there during printing i only need to print the values in correct position.

47pirates 9 Junior Poster in Training

I've a bill which looks like untitled31
this is the paper which i use in printer and i want to print the appropriate value in the correct position of that paper. As in the place of date i want to print date and in the place of Rate, Amount i want to print their respective values. How can i do this in java please help!!

47pirates 9

hello can anybody provide me example relating to bill print in java.

47pirates 9

i mean to say a paper. sorry for my bad english is it possible to do that. How please suggest

47pirates 9

I don't know from where to start. Actual i want to print this type of bill as given below. i need the data to be printed in the correct position as it should be.Please tell give me some examples.
untitled30

47pirates 9 Junior Poster in Training

HOw can i assign a default action of Enter key after cell of jtable is edited to a Button???

47pirates 9

not working!!

Krokcy commented: rude +0

47pirates 9

Not working!!

47pirates 9 Junior Poster in Training

I am trying to update database by editing cell values in jtable. my table looks like a

When i edit the value in particular cell and without clicking anywhere if i click on Update button the database is not updated as like this !
b1
but if i click somewhere in the updating row, which again turns the look of table as fig. 1 then the database is upodated with particular value, why is this happening please help. My code for refresh Button goes like this:

        int pos = recordTable.getSelectedRow();
        int id = (Integer) recordTable.getModel().getValueAt(pos, 0);

        ListSelectionModel selectionModel = recordTable.getSelectionModel();
        selectionModel.setSelectionInterval(pos, pos);

        String roomName = (String) recordTable.getValueAt(pos, 1);
        int roomCharge = Integer.parseInt(recordTable.getModel().getValueAt(pos, 2).toString());
        System.out.println(id + roomName + roomCharge);
        recordTable.revalidate();
        recordTable.repaint();
        admin.updateRoomType(id, roomName, roomCharge);

please help!!

47pirates 9

a template file with place holders for what you want to replace and load the file into memory and do your replacements or you cound use the velocity framework for Java :)

its simply a text document with empty fields.

47pirates 9 Junior Poster in Training

I'm trying to print the necessary values in the predefined document for an example, in a Bill name in the left side and date on top right. I already had that documents with empty name and dates . how can i print the name and date to corresponding location in bill from my program. Please suggest.

47pirates 9

:) thanks job done!!