Click here to Skip to main content
15,913,669 members
Home / Discussions / Java
   

Java

 
QuestionCompiling Java Code Pin
Kevin Marois29-Oct-08 6:29
professionalKevin Marois29-Oct-08 6:29 
AnswerRe: Compiling Java Code Pin
nkadivar29-Oct-08 11:52
nkadivar29-Oct-08 11:52 
AnswerRe: Compiling Java Code Pin
toxcct29-Oct-08 22:31
toxcct29-Oct-08 22:31 
GeneralRe: Compiling Java Code Pin
leesoief4-Nov-08 20:28
leesoief4-Nov-08 20:28 
QuestionJava Servlets with AJAX Pin
ro88o29-Oct-08 5:22
ro88o29-Oct-08 5:22 
QuestionData access objects used in jsp and beans? [modified] Pin
pdoy070827-Oct-08 15:16
pdoy070827-Oct-08 15:16 
QuestionSingle Sign On Pin
vedabj27-Oct-08 1:18
vedabj27-Oct-08 1:18 
Question"Help" JTable problem Pin
slslooo26-Oct-08 20:54
slslooo26-Oct-08 20:54 
Hi,

I have some problem in doing Jtable (I want the JTable to read the data from database) I wrote the code and it work with me in another project but Kow it didn't work I want some one to check this code if I miss some comma or thing in it.

The Code :

//=========================================
package Inventory;

public class cm1 {


private String tables;

public String selectData(String fields, String whereClause) {
if (whereClause == null && fields != null) {
return "SELECT " + fields + " FROM " + this.tables;
} else if (whereClause == null && fields == null) {
return " SELECT * FROM " + this.tables;
} else if (whereClause != null && fields == null) {
return " SELECT * FROM " + this.tables + " WHERE " + whereClause;
} else {
return "SELECT " + fields + " FROM " + this.tables + " WHERE "
+ whereClause;
}

}

//=========================================

public String deleteData(String whereClause) {
return "DELETE " + this.tables + " WHERE " + whereClause;
}
//=========================================

public void setDbTables(String table) {
this.tables = table;
}
//=========================================

public String insertQuery(AddPR p) {
return "INSERT INTO "
+ this.tables
+ " ( ITEMNUM,ITEMTYPE,LOCATION,MANUCODE,FXDASTNUM,MANUSRLNUM,COMMDATE,DESCRIPTION,STATUS,STATUSDATE,MODEL,MSRNUM,COMTYPE,USERNAME,TMSRV,PORT,IPADDRESS,PRICE,PRODUCTIONDATE,YEAR) VALUES ("+ p.getITEMNUM() + ", '" + p.getITEMTYPE() + "', '" + "', '" + p.getLOCATION() + "', '" + "','" + p.getMANUCODE() + "','" + p.getFXDASTNUM() + "', '" + p.getMANUSRLNUM() + "', '" + p.getCOMMDATE() + "', '" + p.getDESCRIPTION() + "', '" + p.getSTATUS() + "', '" + p.getSTATUSDATE() + "','" + p.getMODEL() + "','" + p.getMSRNUM() + "','" + p.getCOMTYPE() + "','" + p.getUSERNAME()+ "','" + p.getTMSRV() + "','" + p.getPORT()+ "','" + p.getIPADDRESS()+ "','" + p.getPRICE()+ "','" + p.getPRODUCTIONDATE() + "', '" +p.getYEAR();
}
}
//========================================="the end of the code"

please help me as soon as possible Blush | :O Blush | :O Blush | :O
QuestionHelp on Search and Replace in a file using java Pin
go4rib24-Oct-08 20:21
go4rib24-Oct-08 20:21 
QuestionHow to specify character encoding in JavaMail? Pin
davilism24-Oct-08 7:26
davilism24-Oct-08 7:26 
QuestionDifferent between JRE 1.6 and JRE 1.5 Pin
utnqbao22-Oct-08 18:53
professionalutnqbao22-Oct-08 18:53 
AnswerRe: Different between JRE 1.6 and JRE 1.5 Pin
toxcct22-Oct-08 21:27
toxcct22-Oct-08 21:27 
GeneralRe: Different between JRE 1.6 and JRE 1.5 Pin
utnqbao22-Oct-08 22:23
professionalutnqbao22-Oct-08 22:23 
GeneralRe: Different between JRE 1.6 and JRE 1.5 Pin
toxcct22-Oct-08 22:33
toxcct22-Oct-08 22:33 
GeneralRe: Different between JRE 1.6 and JRE 1.5 Pin
utnqbao23-Oct-08 0:06
professionalutnqbao23-Oct-08 0:06 
GeneralRe: Different between JRE 1.6 and JRE 1.5 Pin
toxcct23-Oct-08 2:22
toxcct23-Oct-08 2:22 
GeneralRe: Different between JRE 1.6 and JRE 1.5 [modified] Pin
utnqbao23-Oct-08 16:29
professionalutnqbao23-Oct-08 16:29 
QuestionAfter update of fix Windows Update: KB956390, in HTML buttons are developed in VML are not working Pin
ezhil2421-Oct-08 0:03
ezhil2421-Oct-08 0:03 
QuestionDownload JDK 1.6_04 Pin
Kevin Marois20-Oct-08 8:39
professionalKevin Marois20-Oct-08 8:39 
AnswerRe: Download JDK 1.6_04 Pin
toxcct20-Oct-08 21:24
toxcct20-Oct-08 21:24 
Questioncolumns side by side Pin
ic3e18-Oct-08 14:01
ic3e18-Oct-08 14:01 
AnswerRe: columns side by side Pin
sunil_jvfrm1-Nov-08 1:30
sunil_jvfrm1-Nov-08 1:30 
Questionwondering why it doesnt create another text field Pin
srinath158317-Oct-08 23:11
srinath158317-Oct-08 23:11 
Questionsun.net.smtp.SmtpProtocolException help Pin
davilism16-Oct-08 7:12
davilism16-Oct-08 7:12 
QuestionScanner Not Found Pin
Kevin Marois15-Oct-08 12:17
professionalKevin Marois15-Oct-08 12:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.