Jump to content

Jtable in panels and mysql

- - - - -

  • Please log in to reply
2 replies to this topic

#1
manutd112

manutd112

    Newbie

  • Members
  • Pip
  • 2 posts
hey i am new to this forum and i have a question regarding Jtables, panels and mysql..

i am working on a school project where i am making a netbank.. i have come across problem i cant solve.

i want to show information about a customers account in a Jtable, but not by using a Jframe, rather i jpanel, as i am going to run it all via a japplet.

i can do this without a jtable, but i have to do it with a jtable...

my sql quiry looks like this...

the parameter custID is the customers ID....

String SQLQUERY = "SELECT accounts.Account_Name, accounts.Saldo, " +
"useraccounts.Account_NR" +
" from Accounts " +
"INNER JOIN useraccounts on accounts.Account_NR=useraccounts.Account_NR" +
" AND useraccounts.Cust_id=" + custID+";";


I HAVE ATTACHED 3 files, the DBProgram class which handles db connections..

the custFunk class which handles customer functions, its here i want the method show account info to be.

and a customer GUI class which is the gui for the customers. in there i want to push a button and account info is showen...

please helpAttached File  CustGui.java   8.74K   63 downloads

Attached Files



#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Take a look at post #3 on this forum, I think he does what you want there
How to Extract records from Mysql database using JTable - Software Development

#3
manutd112

manutd112

    Newbie

  • Members
  • Pip
  • 2 posts
thank you, but i need the method to be in a seperat class, and the jtable to be in a panel i can call from the main gui....




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users