How to display data from a database to a JComboBox JTextField
Hello
I was wondering I have a database called "PAYTYPE" and have a colums called
EMPLOYEETYPE PAYBASIC PAYSUNDAY PAYHOLIDAY PAYPERIOD
What i want to do is display the list of EMPLOYEETYPE in a combo box(Which i got this part working),
try{
ResultSet rs = db.getResult("Select * FROM PAYTYPE");
while(rs.next())
payTypeField.addItem(rs.getString(2));
}catch(SQLException e)
}When an item is selected from the combo box then the information thats in PAYBASIC,PAYSUNDAY,PAYHOLIDAY, PAYPERIOD will be displayed in textfields
this is the problem im trying to solve
Any Ideas ??????
What im trying to do is the following
on my Gui i have 1 JComboBox and 3 JtextFields
The Jcombo box is populated by the data base
try{
ResultSet rs = db.getResult("Select * FROM EMPLOYEEPAYTYPE");
while(rs.next())
payTypeField.addItem(rs.getString(2));
}catch(SQLException e)
}Now that i have the JComboBox filled I want the other 3 JTextField to be populated with the information that been selected by the JComboBox
I under stand there needs to be a .addActionListener(this) to the JComboBox
payTypeField = new JComboBox();
payTypeField.setBounds(130, 10,100,20);
payTypeField.addActionListener(this);
payTypeField.addItemListener(this);
c.add(payTypeField);I would just like the steps that i need to take in order to fill the JTextBoxes in pudoscode
The information that i need will need to be pulled from the database - EMPLOYEEPAYTYPE
Thanks
Jon
Similar Messages
-
How to display data from mySQL database as a graph?
I am working in DW, is there any function to insert graphs from recordset?
My webpage is in php, don't tell me i have to work in coldfusion in order to display my data from mySQL graphically.
Look at this link: http://www.adobe.com/devnet/coldfusion/articles/basic_chart.html -
How to extract data from oracle database directly in to bi7.0 (net weaver)
how to extract data from oracle database directly in to bi7.0 (net weaver)? is it something do with EDI? can anybody explain me in detail?
Thanks
YorkYou can use UDConnect to get from Oracle database in to BW
<b>Data Transfer with UD Connect -</b>
http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
<b>Prerequisites</b>
You have installed the SAP WAS J2EE Engine with BI Java components. You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
Hope it Helps
Chetan
@CP.. -
How to display data from a recordset based on data from another recordset
How to display data from a recordset based on data from
another recordset.
What I would like to do is as follows:
I have a fantasy hockey league website. For each team I have
a team page (clubhouse) which is generated using PHP/MySQL. The one
area I would like to clean up is the displaying of the divisional
standings on the right side. As of right now, I use a URL variable
(division = id2) to grab the needed data, which works ok. What I
want to do is clean up the url abit.
So far the url is
clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end all
I want is clubhouse.php?team=Wings.
I have a separate table, that has the teams entire
information (full team name, short team, abbreviation, conference,
division, etc. so I was thinking if I could somehow do this:
Recordset Team Info is filtered using URL variable team
(short team). Based on what team equals, it would then insert this
variable into the Divisional Standings recordset.
So example: If I type in clubhouse.php?team=Wings, the Team
Info recordset would bring up the Pacific division. Then 'Pacific'
would be inserted into the Divisional Standings recordset to
display the Pacific Division Standings.
Basically I want this
SELECT *
FROM standings
WHERE division = <teaminfo.division>
ORDER BY pts DESC
Could someone help me, thank you.Assuming two tables- teamtable and standings:
teamtable - which has entire info about the team and has a
field called
"div" which has the division name say "pacific" and you want
to use this
name to get corresponding details from the other table.
standings - which has a field called "division" which you
want to use to
give the standings
SELECT * FROM standings AS st, teamtable AS t
WHERE st.division = t.div
ORDER BY pts DESC
Instead of * you could be specific on what fields you want to
select ..
something like
SELECT st.id AS id, st.position AS position, st.teamname AS
team
You cannot lose until you give up !!!
"Leburn98" <[email protected]> wrote in
message
news:[email protected]...
> How to display data from a recordset based on data from
another recordset.
>
> What I would like to do is as follows:
>
> I have a fantasy hockey league website. For each team I
have a team page
> (clubhouse) which is generated using PHP/MySQL. The one
area I would like
> to
> clean up is the displaying of the divisional standings
on the right side.
> As of
> right now, I use a URL variable (division = id2) to grab
the needed data,
> which
> works ok. What I want to do is clean up the url abit.
>
> So far the url is
clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end
> all
> I want is clubhouse.php?team=Wings.
>
> I have a separate table, that has the teams entire
information (full team
> name, short team, abbreviation, conference, division,
etc. so I was
> thinking if
> I could somehow do this:
>
> Recordset Team Info is filtered using URL variable team
(short team).
> Based on
> what team equals, it would then insert this variable
into the Divisional
> Standings recordset.
>
> So example: If I type in clubhouse.php?team=Wings, the
Team Info recordset
> would bring up the Pacific division. Then 'Pacific'
would be inserted into
> the
> Divisional Standings recordset to display the Pacific
Division Standings.
>
> Basically I want this
>
> SELECT *
> FROM standings
> WHERE division = <teaminfo.division>
> ORDER BY pts DESC
>
> Could someone help me, thank you.
> -
Walkthrough: Displaying Data from Oracle database in a Windows application.
This article is intended to illustrate one of the most common business scenarios such as displaying data from Oracle database on a form in a Windows application using DataSet objects and .NET Framework Data Provider for Oracle.
You can read more at http://www.c-sharpcorner.com/UploadFile/john_charles/WalkthroughDisplayingDataOracleWindowsapplication05242007142059PM/WalkthroughDisplayingDataOracleWindowsapplication.aspx
Enjoy my article.hi,
this is the code :
public class TableBean {
Connection con ;
Statement ps;
ResultSet rs;
private List perInfoAll = new ArrayList();
public List getperInfoAll() {
int i = 0;
try
con = DriverManager.getConnection("url","root","root");
ps = con.createStatement();
rs = ps.executeQuery("select * from user");
while(rs.next()){
System.out.println(rs.getString(1));
perInfoAll.add(i,new perInfo(rs.getString(1),rs.getString(2),rs.getString(3)));
i++;
catch (Exception e)
System.out.println("Error Data : " + e.getMessage());
return perInfoAll;
public class perInfo {
String uname;
String firstName;
String lastName;
public perInfo(String firstName,String lastName,String uname) {
this.uname = uname;
this.firstName = firstName;
this.lastName = lastName;
public String getUname() {
return uname;
public String getFirstName() {
return firstName;
public String getLastName() {
return lastName;
ADF table code:
<af:table value="#{tableBean.perInfoAll}" var="row"
binding="#{backing_Display.table1}" id="table1">
<af:column sortable="false" headerText=""
align="start">
<af:outputText value="#{row.firstName"/>//---> Jdeveloper 11g doesn't allow me to use this.. it says firstName is an unknown property..
</af:column>
</af:table>
Please tell me is this the way to do it.. or is it a must to use the DataCollection from the data controls panel...
Thanks... -
How to fetch data from single database table using 2 internal tables.
Hi friends,
i am a new user of ABAP and also SDN.
i need a help.
i want to fetch data from one database table based on primary keys of 2 internal tables. how to put in where clause.
Thanks in advance.hii
refer to following code ..i hope it will help you
SELECT matnr " Material Number
FROM mara
INTO TABLE i_mara
WHERE matnr IN s_matnr.
IF i_mara[] IS NOT INITIAL.
SELECT matnr " Material Number
werks " Plants
prctr " Profit Center
FROM marc
INTO TABLE i_marc
FOR ALL ENTRIES IN i_mara
WHERE matnr = i_mara-matnr
AND werks IN s_werks.
ENDIF. " IF i_mara[] IS NOT INITIAL
i_output = i_marc.
IF i_marc[] IS NOT INITIAL.
SELECT matnr " Material Number
werks " Plants
lgort " Storage Location
FROM mard
INTO TABLE i_mard
FOR ALL ENTRIES IN i_marc
WHERE matnr EQ i_marc-matnr
AND werks EQ i_marc-werks
AND lgort IN s_lgort.
ENDIF. " IF i_mara[] IS NOT INITIAL
regards
twinkal -
How to display data from Database individually??? Anyone can help ?
HI,
i i had select a row of data from database using ,
/* Query * From Table RESOURCEORDER where po = selected no and project = selected project */
public ResultSet getAllData() throws SQLException
getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM RESOURCEORDER WHERE PROJECT = '" + getSelProject() + "' and PURCHASEORDERNO = '" + getPo() + "'" );
return rs;
After that , how do i display the data individually ?
Eg select data is ('projectA','7891203-1', '10-4-2005','lcd',2000,'121-45217-8','electrical','pending','donwong')
i want to display them individually, like this in a page
Projectname: /* should display the Project A*/
P.O no:
Date:
Order:
Cost:
Acc no:
Type:
status:
Orderedby:
Can anyone help ? cos i'm new to JSP ......Thanks alot!!!!!
Regards,
khimI assume PO being a unique key, will always return 1 row from db.
public String[] getAllData() throws Exception
getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM RESOURCEORDER WHERE PROJECT = '" + getSelProject() + "' and PURCHASEORDERNO = '" + getPo() + "'" );
String [] returnValue = new String[9];
while(rs.next())
returnValue[1] = rs.getString("colname");
returnValue[2] = rs.getString("colname");
///and so on
return returnValue;
}Once you get that you could individually view it by setting a loop to run through the returned array.
Hope it helps -
How to migrate data from one database to another for a specific time frame
Hi
This is the scenario:
We have 2 databases:
PTT : THis has data from march 11 to March 19 that was created when the production was down due to a crash
PROD : THis was recovered after March 19. Hence has no data created between March 11 and March 19
How do I transfer this data from March 11 to March 19 from PTT to PROD so that Production can be up to date asap.
Please let meknow the methods to get this done
Regards
GayathriHi,
You could use EXP/IMP to move the data from PTT to PROD. But, you should be careful with sequences, modification to the same data.....
eg Customer Address was updated between Mar 11 - 19, again the same customers was updated after 19 Mar, under this situation if you load the data from PTT you would be wrongly updating the data.....
You have to study well and apply changes........... -
Displaying data from a Database control
I'm retrieving data from a sybase database into a java class and then pass that
through to my jsp page. This works fine, as long as the sql actually returns a
value (This specific query only returns one or none records).
If no records were found, my jsp page displays an error message "Caught exception
when evaluating expression "{pageFlow.m_dates.mon_am_loc}" with available binding
contexts [actionForm, pageFlow, globalApp, request, session, appication, pageContext,
bundle, container, url, pageInput]. Root cause: knex.scripting.javascript.EvaluatorException:
The undefined value has no properties."
the call in my .jsp looks as follow : <netui:label value="{pageFlow.m_dates.mon_am_loc}"
escapeWhiteSpaceForHtml="false"/>
.... and is part of a repeter item tag.
Any help would be appreciated.
Hi Jothivenkatesh M,
Place the cursor in forst field and press CNT+y now select the entair row by using your mouce and press CNT+C and paste the data in what ever position.
Plzz rewad if it is useful,
Mahi. -
How to read data from Logical Database ADA for more than one financia year
Hi,
I need to read data from ADA logical database and ANLCV node for current financial year 2007 and for the next 3 years 2008, 2009, 2010. When I do this using program attached below, I receive only data for one year, which is entered at the selection screen in the field BERDATUM. How should I modify my program to read ANLCV node for more then one year ? Could anybody help me ?
Kind regards,
Zbigniew Debowski
REPORT ZWRZD075.
NODES: anlav, anlcv.
START-OF-SELECTION.
GET anlav.
WRITE:/ anlav-anln1, ' ', anlav-anln2.
GET anlcv.
WRITE:/ anlcv-kansw, ' ', anlcv-knafa, ' ', anlcv-gjahr.Hi!
Have you already tried your luck in Java Programming forum?
Regards,
Thomas -
How to read data from SAP database in java?
Hi All ,
I want to read some tables from SAP database in java? How to connect to SAP database in java.I want to read the data from SAP NetWeaver BW 7.3.
Please help..Download Vder [http://binhgiang.sourceforge.net/site/download.jsp|http://binhgiang.sourceforge.net/site/download.jsp]
Extract date from website, output to xml format then save to database (MySQL, Oracle,...)
Screenshot: [http://binhgiang.sourceforge.net/xmlalbum/screenshots.html|http://binhgiang.sourceforge.net/xmlalbum/screenshots.html]
Edited by: Nhu_Dinh_Thuan on Jul 23, 2009 9:55 PM
Edited by: Nhu_Dinh_Thuan on Jul 23, 2009 9:56 PM -
How to Display Data from Oracle E Business Suite tables in ADF
Hi,
I am new to ADF.
I have a requirement to Create an ADF page for Search Results Screen.
However the result data is from one of the Oracle E Business Suite Tables.
ie I need to create a Screen where user will enter a Purchase Order Number and Click on Button.
The Screen should show details from PO_HEADERS_ALL (from Oracle ERP Database Table) based on the entered PO Number.
Is it possible to implement the same? Can some one guide me how to do it?
Thanks,
KamathHi,
Is there a way where I can create a VO in ADF to which I can insert records dynamically from a source and the Source connects to E Business Suite tables and returns results ie BPEL etc.
http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvvo.htm#sm0341
Just replace the PLSQL example with your data source
Can ADF invoke SOA which inturn connects to Oracle E Business Suite and fetches the data from Oracle tables and pass it back to ADF? Is it possible
Yes. Just use a WS proxy client to access the SOA entry point (WSDL) and follow the link above
Frank -
How to load data from different database
Hi,
My problem is how to load Foxpro 2.6/clipper data into oracle 8 with all its structure and data with SQL loader or other utility if any.
And also how can i integrate existing forpro system into Oracle. i.e client will work on Foxpro application and we will only take its output(data files) on daily basis and convert it into Oracle 8.
Please find any solution.
Regards
nullYou can also try to make up an ODBC connection to Foxpro and convert the data from foxpro to oracle using the COPY command (see docs on PL/SQL & OCA). I remember that foxpro/clipper are running on MS-DOS, so I don't know if you can establish an ODBC connection to oracle which can be used from the foxpro/clipper application to use it as a frontend for an oracle database.
Regards, Kai
null -
How to retrive data from MYSQL database beginner question
I need to know a method, on how to retrieve values from a MYSQL database. I finally managed to insert data to a MySql database using hibernate, with the help of google. but, i couldn't find any helpful article on google, on retrieving data, will some plzz help me, by directing me to a site that has sample codes ??
i am actually new to MYSql and Databases in java, so plzz do help me, i am lost here,,, :(Oh, it's Hibernate. In the future, please use the forums at their own site.
Answers on how to use Hibernate are usually available in the excellent "Hibernate Reference Documentation" available here. -
How can extract data from foxpro database?who can help me?
I use jdbc-odbc to connect to my database ,database is foxpro, in the database there is a table named "tlb", I can select the table the total roll nums,but when I select the data from the roll, I cannot get the data, this data type is memo type, I don't know how get this data!
I remember question about a memo type in Access and maybe also SQLServer. Is this the same like in FoxPro?
If, then you might get help by searching this forum for "memo".
Maybe you are looking for
-
How to maintain Space between text in Smart form
Hi Experts, How to maintain space between text in smat form. For example I need to maintain like this Prepared By: Passed By: Approved By: but after save it come like this Prepared By: Passed By:
-
Preloader AS2 wont work in FL CS3?!
this is strange and i can only think it's me who's missing something. i have a preloader script i used with Flash 8 but when i try to attach it in the movie i made in FL CS3 it doesn't work (the new movie is in AS2). can anyone tell what i'm doing wr
-
How do you close by ledger in ECC 6.0? I am familiar with OB52 in controlling various sub-ledgers but have only heard about being able to close by various parallel ledgers.
-
Laptop not recognizing old ram
Hello everyone. First time poster here, needing some advice.<br><br>Well I had applied new quality thermal paste and cleaned out the vents to my rig presario cq62.<br><br>After doing everything, it's not recognizing one stick of ram. I switched them
-
ACR version mismatch - two versions show as installed
Photoshop CS - installed 2.4 then attempted to install version supporting Nikon D70s. When 4.4.1 reported as not compatible, moved it out of File Formats and moved 2.4 back in. "System Info" now shows both installed (only one is in place) and display