adasi

Member
Jul 1, 2011
22
0
0
41
Ruwanwella
akhila ayya.......

* mata one...table ekak custermize karaganna....
* mama table customize karala thiyenawa..

mata one...,

*Table ekak Row ekak uda click karala ENTER Button eka press kalama...ema Row ekema next Column eka forcus wenna one...(mama eka tikak kala).

*Eka row ekaka(see Table2.jpg). eke account no eka type karala Enter key eka press kalama..E row eke anik column fill wenna one database eken..

*Apita ewa edit karanna puluwan wenna one(Book balance)..row ekaka last column eka edan Enter press kalama New row ekak Add wenna one...kalin row eke data save wennath one...

mama sahena durata customize kala...but database eken,,row ekakata witharak data ganna widiya danne na....please help....
 

Attachments

  • Table2.jpg
    Table2.jpg
    19.5 KB · Views: 94

akhilapraveen

Active member
  • Jun 2, 2008
    335
    72
    28
    akhila ayya.......

    * mata one...table ekak custermize karaganna....
    * mama table customize karala thiyenawa..

    mata one...,

    *Table ekak Row ekak uda click karala ENTER Button eka press kalama...ema Row ekema next Column eka forcus wenna one...(mama eka tikak kala).

    *Eka row ekaka(see Table2.jpg). eke account no eka type karala Enter key eka press kalama..E row eke anik column fill wenna one database eken..

    *Apita ewa edit karanna puluwan wenna one(Book balance)..row ekaka last column eka edan Enter press kalama New row ekak Add wenna one...kalin row eke data save wennath one...

    mama sahena durata customize kala...but database eken,,row ekakata witharak data ganna widiya danne na....please help....



    gmme tha database details. and if can send me ur folder to [email protected]
    ill help u asap..
     

    adasi

    Member
    Jul 1, 2011
    22
    0
    0
    41
    Ruwanwella
    Akhila ayya.....

    Mama use karanne database tool eka MySQLYog eka.....

    mata ayya client machin eke edan server machin eka thiyena database eka
    access karanna bane?

    i use cording.......

    String driver="com.mysql.jdbc.Driver";
    String url="jdbc:mysql://192.168.1.14:3307/";
    String dbName="easyBanker";
    String uName="root";
    String pWard="123";

    192.168.1.14 is server IP....

    *mama mysql install kale 3307 port ekata.....eka awulakda?
    *localhost IP eka(127.0.0.1) change karanna oneda 192.168.1.14 ekata??

    localhost IP eka change karana widiya mama danne na ayya....

    mama me karala thiyena method eka waradida?

    puluwannam mata help ekak denna ayya please...loku udawwak...
     

    akhilapraveen

    Active member
  • Jun 2, 2008
    335
    72
    28
    malli java connect wenawada?
    mysql 5.5.12 use karanna kiyala tamai mata kiyannna tiyenne!
    it suits for yur project

    and you can access server pc a tru a client pc. you can do that by giving a user extension.

    but its not good for security!

    anit eka malli banking softwares jtable walin hadana eka tikak unsecured.
    mokada eka row ekak upset giyot mulu server ekama down. but if u wanna do that in that way its ok

    mamanam kiyanne jlist use karanna kiyala tamai wadeta.

    oya mehema karanna,

    create 1 jtable and 1 jlist
    jtable eka passe hidden karanna puluwan ne

    j table eke row ekak call karama(primary key from a database) ema row eke anit colmns okkama tika fill wenna danna.
    ------------------------------------------------


    now im gnna tell a step about security(if u dnt want u can remove this part)

    table eke 1 row ekak tibbama ati
    dan e colmn eke tiyana values okkama tika text sheet ekakata pass karanna.
    values tika pass wechcha gamanma table eka clear wenna set karanna

    -------------------------------------------------

    dan jlist ekata ids tika enna set karaganna (directly from database)
    dan oya jlist eken id ekak pick karala get values kiyana button eka click karama, jtable eka values tika aran eka sheet ekakata pass karala sheet eken gannawa!

    me vidihata karot security is 100%!!
    mokada kaaru hari values ganna try kalot client pc ekakin eyata ganna ba!
    mokada values server pc eke tiyana text sheet ekakta save wela tiyenne!(ethana witarai anthimata data tiyenne) ethanin tama gannawanm ganna one!
    hacker kenekta puluwan network eka hack karala network eke tiyana data steal karanna tamai
    but he cant hack a personal computer and steal data from a temporary text sheet!(its 1000 times harder )

    wade terunanam ela!
    nattam aye ahanna kisi awulak na malli!
     

    adasi

    Member
    Jul 1, 2011
    22
    0
    0
    41
    Ruwanwella
    malli java connect wenawada?
    mysql 5.5.12 use karanna kiyala tamai mata kiyannna tiyenne!
    it suits for yur project

    and you can access server pc a tru a client pc. you can do that by giving a user extension.

    but its not good for security!

    anit eka malli banking softwares jtable walin hadana eka tikak unsecured.
    mokada eka row ekak upset giyot mulu server ekama down. but if u wanna do that in that way its ok

    mamanam kiyanne jlist use karanna kiyala tamai wadeta.

    oya mehema karanna,

    create 1 jtable and 1 jlist
    jtable eka passe hidden karanna puluwan ne

    j table eke row ekak call karama(primary key from a database) ema row eke anit colmns okkama tika fill wenna danna.
    ------------------------------------------------


    now im gnna tell a step about security(if u dnt want u can remove this part)

    table eke 1 row ekak tibbama ati
    dan e colmn eke tiyana values okkama tika text sheet ekakata pass karanna.
    values tika pass wechcha gamanma table eka clear wenna set karanna

    -------------------------------------------------

    dan jlist ekata ids tika enna set karaganna (directly from database)
    dan oya jlist eken id ekak pick karala get values kiyana button eka click karama, jtable eka values tika aran eka sheet ekakata pass karala sheet eken gannawa!

    me vidihata karot security is 100%!!
    mokada kaaru hari values ganna try kalot client pc ekakin eyata ganna ba!
    mokada values server pc eke tiyana text sheet ekakta save wela tiyenne!(ethana witarai anthimata data tiyenne) ethanin tama gannawanm ganna one!
    hacker kenekta puluwan network eka hack karala network eke tiyana data steal karanna tamai
    but he cant hack a personal computer and steal data from a temporary text sheet!(its 1000 times harder )

    wade terunanam ela!
    nattam aye ahanna kisi awulak na malli!


    Thanks ayya i will try.you are great..
    Jaya wewa!!!!!
     

    adasi

    Member
    Jul 1, 2011
    22
    0
    0
    41
    Ruwanwella
    malli java connect wenawada?
    mysql 5.5.12 use karanna kiyala tamai mata kiyannna tiyenne!
    it suits for yur project

    and you can access server pc a tru a client pc. you can do that by giving a user extension.

    but its not good for security!

    anit eka malli banking softwares jtable walin hadana eka tikak unsecured.
    mokada eka row ekak upset giyot mulu server ekama down. but if u wanna do that in that way its ok

    mamanam kiyanne jlist use karanna kiyala tamai wadeta.

    oya mehema karanna,

    create 1 jtable and 1 jlist
    jtable eka passe hidden karanna puluwan ne

    j table eke row ekak call karama(primary key from a database) ema row eke anit colmns okkama tika fill wenna danna.
    ------------------------------------------------


    now im gnna tell a step about security(if u dnt want u can remove this part)

    table eke 1 row ekak tibbama ati
    dan e colmn eke tiyana values okkama tika text sheet ekakata pass karanna.
    values tika pass wechcha gamanma table eka clear wenna set karanna

    -------------------------------------------------

    dan jlist ekata ids tika enna set karaganna (directly from database)
    dan oya jlist eken id ekak pick karala get values kiyana button eka click karama, jtable eka values tika aran eka sheet ekakata pass karala sheet eken gannawa!

    me vidihata karot security is 100%!!
    mokada kaaru hari values ganna try kalot client pc ekakin eyata ganna ba!
    mokada values server pc eke tiyana text sheet ekakta save wela tiyenne!(ethana witarai anthimata data tiyenne) ethanin tama gannawanm ganna one!
    hacker kenekta puluwan network eka hack karala network eke tiyana data steal karanna tamai
    but he cant hack a personal computer and steal data from a temporary text sheet!(its 1000 times harder )

    wade terunanam ela!
    nattam aye ahanna kisi awulak na malli!


    akhila ayya..........

    Mama okkoma tables,views,stored procedures okkoma hadala thiyenne MySQLYoung eke haraha..stored procedure ekema jlist wala wada karanne nane?
    ehema unoth eka loku awulak we....
    Mata dan thiyena loku awula localhost IP ekata ape machin IP eka set karaganna eka...
    mama use karanne MySQL 5.5.9....

    mama mokadda karanna one ayya....

    Win 7 and Win XP connect wenne nathi seen ekak thiyenawada?
     

    akhilapraveen

    Active member
  • Jun 2, 2008
    335
    72
    28
    values jtalbe ekaka aran eken text ekakata aran eken jlist ekata ganna!

    malli sql5.* kohomat 7 wala awul!
    anit eka banks wala oya wage virtual networks use karanna
     

    adasi

    Member
    Jul 1, 2011
    22
    0
    0
    41
    Ruwanwella
    values jtalbe ekaka aran eken text ekakata aran eken jlist ekata ganna!

    malli sql5.* kohomat 7 wala awul!
    anit eka banks wala oya wage virtual networks use karanna


    akhila ayya....

    server ekath ekka connect wena wade hari giya....api systems karanne Rural bank(sanasa,grameeya) wage ewata...ewage bank bank network wela nane...
    mama passe jtable jlist walata convert karannam....

    thanks for your ideas...jaya wewa...
     

    akhilapraveen

    Active member
  • Jun 2, 2008
    335
    72
    28
    Akhila ayya.....

    LAN eka haraha PC to PC SMS yawana method ekak thiyenawa ne?
    mata e gana idea akak na...

    idea ekak dennako please...


    pc lan karala tiyana kota paticuler pc eka allow karanawanam ema pc eka fully access karanna anit pc walata puluwan.

    windows xp wala net meeting kiyala software ekak tiyanawa(run in cmd)
    windows 7 walin meka lesiyenma karanna puluwan.(jus goto control panel and network and internet --->homegroup)

    oyata oyage software ekenma meka karanna one nam java walin system calls liyanna mekama wena!
     

    sandhanuwan1

    Well-known member
  • Aug 22, 2009
    2,741
    352
    83
    machan mata one numbers jenarete karanna
    e kiyanne
    Mysql database eke invoice number 122, 123, 124, 125 wage numbers tikak thiyanawanam
    mata one eka auto search welaa iilagata save karana eke invoice number eka 126 watenna
    mama netbeans wala thamai ban project eka design karanne
     

    pradeep0079

    Member
    Aug 19, 2010
    151
    8
    0
    machen uba kiyanne invoice number eka auto generate karanne kohomada kiyalada like 1,2,3 or 00001,0002,0003
    is that i will mention some method but this is for enterprise db ,i don't remember mysql so you get the concept and impliment on mysql

    method 1:
    get the count in invoice table and increment it by one
    select count(*)+1 as serial from yourtable
    this is one method but it has some draw backs

    second method:
    create a index or sequence
    CREATE SEQUENCE your_seq
    INCREMENT 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    START 1
    CACHE 1;
    ALTER TABLE your_seq OWNER TO enterprisedb;

    using sequence you can do it two ways
    1.use it in your insert query
    like insert into your_table(column names) values (,,,,,your_seq.nextval)
    2. use a stored procedure to generate patterned serial
    function fc_get_orderno
    return varchar is
    begin

    return lpad(seq_your.nextval,4,0);
    end;
    this will return a number like 0001,0002

    3.use a sepearte table for sequence
    create a tabe with columns srial_name,serial_vale with varchar ,number
    then
    in your code get the serial_vale +1 from your table
    after you have to update it

    let say you have 30 in your serial_value
    then you get 31
    then you have to update 31 as your serial value
    but remenber you have to handle concurrency in your code and db
    otherwise this will be a mess

    i recommend 2 method since db handle the concurrency and i most used it
     

    adasi

    Member
    Jul 1, 2011
    22
    0
    0
    41
    Ruwanwella
    akhila ayya...

    mama CVS file ekakata data pass karala eka report ekakata ganne?
    mata one CVS file eka fill wenna kalin,CVS file eke kalin data delete karanna.
    mama use karapu code eka

    String outputFile = "D:\\easyBanker\\Text_Files\\test.csv";

    boolean alreadyExists = new File(outputFile).exists();

    if(alreadyExists){
    new File(outputFile).delete();

    }

    but CVS file eka delete wenne nane?
    file eka delete karana wena widiyak thiyenawada?
     

    pradeep0079

    Member
    Aug 19, 2010
    151
    8
    0
    try these


    1. try
    2. {
    3. fW = new BufferedWriter(new FileWriter("Pedidos_Formacao.txt"));
    4. fW.write("Pedido");
    5. fW.newLine();
    6. fW.close;
    7. }

    use this code it will override your file


    FileOutputStream erasor = new FileOutputStream("yourFileName.txt");
    erasor.write((new String()).toByteArray());
    erasor.close();

    Or

    File yourFile = new File("yourFileName.txt");
    yourFile.delete();
    File yourNewFile = new File("youFileName.txt");
    yourNewFile.createNewFile();
    yourNewFile.close();

    also check this forum
    http://www.javakb.com/Uwe/Forum.aspx/java-setup/11585/Deleting-contents-of-file
     

    akhilapraveen

    Active member
  • Jun 2, 2008
    335
    72
    28
    try these


    1. try
    2. {
    3. fW = new BufferedWriter(new FileWriter("Pedidos_Formacao.txt"));
    4. fW.write("Pedido");
    5. fW.newLine();
    6. fW.close;
    7. }

    use this code it will override your file


    FileOutputStream erasor = new FileOutputStream("yourFileName.txt");
    erasor.write((new String()).toByteArray());
    erasor.close();

    Or

    File yourFile = new File("yourFileName.txt");
    yourFile.delete();
    File yourNewFile = new File("youFileName.txt");
    yourNewFile.createNewFile();
    yourNewFile.close();

    also check this forum
    http://www.javakb.com/Uwe/Forum.aspx/java-setup/11585/Deleting-contents-of-file

    agree.
    or u can just erase characters using string patterns.
     

    adasi

    Member
    Jul 1, 2011
    22
    0
    0
    41
    Ruwanwella
    FileOutputStream erasor = new FileOutputStream("yourFileName.txt");
    erasor.write((new String()).toByteArray());
    erasor.close();

    eke.......

    toByteArray()

    kiyana method eka nane packge eke...i use JDK 6...

    *******************************************************

    mage programe eka on wela thiyeddi CSV file eka manually wath delete karanna bane...
    program eka close karapuhama CSV file makanna puluwan....

    mata one new data add wenakota old data erase karanna...







     

    pradeep0079

    Member
    Aug 19, 2010
    151
    8
    0
    sorry machan mama oka run kalenehe time nathinisa
    me code eka use karapan

    FileOutputStream erasor = new FileOutputStream("yourFileName.txt");
    erasor.write((new String()).getBytes());
    erasor.close();
     

    pradeep0079

    Member
    Aug 19, 2010
    151
    8
    0
    machen uba kiyanne invoice number eka auto generate karanne kohomada kiyalada like 1,2,3 or 00001,0002,0003
    is that i will mention some method but this is for enterprise db ,i don't remember mysql so you get the concept and impliment on mysql

    method 1:
    get the count in invoice table and increment it by one
    select count(*)+1 as serial from yourtable
    this is one method but it has some draw backs

    second method:
    create a index or sequence
    CREATE SEQUENCE your_seq
    INCREMENT 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    START 1
    CACHE 1;
    ALTER TABLE your_seq OWNER TO enterprisedb;

    using sequence you can do it two ways
    1.use it in your insert query
    like insert into your_table(column names) values (,,,,,your_seq.nextval)
    2. use a stored procedure to generate patterned serial
    function fc_get_orderno
    return varchar is
    begin

    return lpad(seq_your.nextval,4,0);
    end;
    this will return a number like 0001,0002

    3.use a sepearte table for sequence
    create a tabe with columns srial_name,serial_vale with varchar ,number
    then
    in your code get the serial_vale +1 from your table
    after you have to update it

    let say you have 30 in your serial_value
    then you get 31
    then you have to update 31 as your serial value
    but remenber you have to handle concurrency in your code and db
    otherwise this will be a mess

    i recommend 2 method since db handle the concurrency and i most used it





    Code:
    machan mewage table ekak create karapan ube db eke 
    data type wenaswenna puluwan db eka wenasnum mama use karanne enterprisedb 8.3r2
    -------------------------------------------------------------------------------------------------------------------------------------------
    CREATE TABLE yourname_serials
    (
      serial_name character varying NOT NULL,
      serial_code integer NOT NULL,
      CONSTRAINT yourname_serials_pkey PRIMARY KEY (serial_name)
    )
    
    oya tbale eka dan insert karapan values 
    INSERT INTO eti_serials(
                serial_name, serial_code)
        VALUES ('your_serial',0);
    
    // me method eken thama serial eka generate karanne 
    public String generatePurchaseOrderSerial() {
            Connection c = null;
            Statement s = null;
            ResultSet rs = null;
            DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
            String serial = "";
            String sql = "SELECT lpad(to_number(serial_code)+1,6,'0') as  serial,to_number(serial_code)+1 sid  FROM your_serials where  serial_name='po_serial';";
    
            String serialx = "";
            int tserial = 0;
            try {
                DBConnection bConnection = new DBConnection();
                c = bConnection.getDBConnection_luser();
    
                // c.setTransactionIsolation(c.TRANSACTION_READ_COMMITTED);
                c.setAutoCommit(false);
    
                s = c.createStatement();
                rs = s.executeQuery(sql);
                if (rs != null) {
                    while (rs.next()) {
                        serialx = rs.getString("serial");
                        tserial = rs.getInt("sid");
                    }
                }
                String updatesql = "update eti_serials set serial_code=" + tserial + "  where serial_name='po_serial' ";
                s.executeUpdate(updatesql);
    
    
    
                c.commit();
                rs.close();
                s.close();
                c.close();
                return serialx;
            } catch (Exception e) {
                try {
                    c.rollback();
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
    
    
                return null;
            } finally {
                try {
                    if (rs != null) {
                        rs.close();
                    }
                    if (s != null) {
                        s.close();
                    }
                    if (c != null) {
                        c.close();
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
    
            }
        }
    
    
    private void btnNewOrderActionPerformed(java.awt.event.ActionEvent evt) {                                            
            // TODO add your handling code here:
            try {
                String serial = bHelper.generatePurchaseOrderSerial_general();
                txtPoNo.setText(serial);
               
            } catch (Exception e) {
                e.printStackTrace();
    
            }
        }  
    
    // oya generate order serial kiyana method eke  mehema seen ekak thiyenawa.
    ekiiyanne eka serial eka gattha gaman serial_value eka update karanawa.
    eke problem eke wenne uba aluth order eka cancel karoth serial order eka 1 kin paninawa
    ekiyanne 
    api kiyamu dan thiyenne 00001 kiyala 
    ita passe uba igawa order eka cancel karanawa 00002
    but database eke thiyeene update wechcha eka ekiyanne uba cancel kalata serial eka reverse wenne nehe 
    eka nisa ubta ilaga order number eka enne 00003
    
    
    habai eka machine ekaka witharak num run wenne mama method ekak dannum 
    ethakota order eka save wenakota thma serial eka update wenne 
    ethakota oya problem eka nehe.
    habai meka use karanne puluwan only for one user nathnum concureency problem ennawa
    
    uba me method eka use karanawanum 
    generatePurchaseOrderSerial  me method eke thiye serial_update query eka comment karapan.
    ita passe save button event ekedi 
    me method eka call karapan  if save is success
    
    mekata serial walue eka pass karapan ,ara issella method eken gattha serial value eka 
    
    
    
    
    ekiiwe oya code eken gattha serial eka 
      //        String serial = bHelper.generatePurchaseOrderSerial_general();
    //    txtPoNo.setText(serial);
    
    menna me widiyata convert karala ganin 
    
     int serial = Integer.parseInt(txtPoNo.getText());
    
    
    in your save button if (success){
     bHelper.updatePurchaseOrderSerial_general(serial);
    }
    
    ///
    public String updatePurchaseOrderSerial_general(int serial) {
            Connection c = null;
            Statement s = null;
            ResultSet rs = null;
            DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
    
    
            String serialx = "";
            int tserial = 0;
            try {
               DBConnection bConnection = new DBConnection();
                c = bConnection.getDBConnection_luser();
    
                // c.setTransactionIsolation(c.TRANSACTION_READ_COMMITTED);
                c.setAutoCommit(false);
    
                s = c.createStatement();
    
                String updatesql = "update your_serials set serial_code=" + serial + "  where serial_name='po_gen' ";
                s.executeUpdate(updatesql);
    
    
    
                c.commit();
                rs.close();
                s.close();
                c.close();
                return serialx;
            } catch (Exception e) {
                try {
                    c.rollback();
                } catch (Exception ex) {
                    ex.printStackTrace();
    
                }
    
    
                return null;
            } finally {
                try {
                    if (rs != null) {
                        rs.close();
                    }
                    if (s != null) {
                        s.close();
                    }
                    if (c != null) {
                        c.close();
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
    
            }
        }