alexa-tracking

[HELP] saya baru belajar java & postgresql, ada eror ,ada yg bisa bantu ??

Main Content

1024
1024
KASKUS
51
244
https://www.kaskus.co.id/thread/5afbe538dad770d1428b4573/help-saya-baru-belajar-java-amp-postgresql-ada-eror-ada-yg-bisa-bantu
[HELP] saya baru belajar java & postgresql, ada eror ,ada yg bisa bantu ??
code error nya sperti ini

[HELP] saya baru belajar java & postgresql, ada eror ,ada yg bisa bantu ??

ini SQL Codenya
Code:
-- Table: jadwal0

-- DROP TABLE jadwal0;

CREATE TABLE jadwal0
(
id character varying(50) NOT NULL, -- Kode
createby character varying(10),
created date,
updateby character varying(10),
updated date,
client character varying(3),
divisi character varying(3),
isactive character varying(1),
noso character varying(15), -- NOSO
tanggal date, -- Tanggal
tgl_mulai date NOT NULL, -- Tanggal Mulai
tgl_selesai date NOT NULL, -- Tanggal Selesai
cicilan integer NOT NULL, -- Cicilan
refjurnal character varying(15),
isprinted character varying(1) NOT NULL,
netamount double precision, -- Total
customerid character varying(15) NOT NULL, -- Customer
customeriddescr character varying(50) NOT NULL, -- Customer
descr character varying(150) NOT NULL DEFAULT ''::character varying, -- Keterangan
deposit double precision, -- Deposit
geninvdep character(1), -- Buat Tagihan Deposit? (S/Y)
luas double precision DEFAULT 0, -- Luas Unit
tglfitting date, -- Tgl Fitting Out
toko character varying(250), -- Nama Toko
jenisusaha character varying(200), -- Jenis Usaha
notaris character varying(50), -- Nama Notaris
pemakaiiddescr character varying(50), -- Pemakai
tgl_mulai_pakai date, -- Tgl Mulai Pakai
tgl_selesai_pakai date, -- Tgl Selesai Pakai
salesid character varying(15) NOT NULL DEFAULT ''::character varying, -- Sales
salesiddescr character varying(50) NOT NULL DEFAULT ''::character varying, -- Sales
pajakid character varying(15) NOT NULL DEFAULT ''::character varying, -- PPN
pajakiddescr character varying(50) NOT NULL DEFAULT ''::character varying, -- PPN
pphid character varying(15) NOT NULL DEFAULT ''::character varying, -- PPH
pphiddescr character varying(50) NOT NULL DEFAULT ''::character varying, -- PPH
dp integer NOT NULL DEFAULT 0, -- DP (Cicilan)
pctdp double precision NOT NULL DEFAULT 0, -- DP (Persen)
tipe character varying(3) DEFAULT 'RTL'::character varying, -- Tipe
bf double precision NOT NULL DEFAULT 0, -- Booking Fee
approveby character varying(11) DEFAULT ''::character varying, -- Disetujui Oleh
approvedate date, -- Disetujui Tanggal
approvecreate character(1),
approveupdate character(1),
cicilanid character varying(15), -- Metode Pembayaran
updatedescr character varying(50) NOT NULL DEFAULT ''::character varying, -- Alasan Update
discpct1 double precision, -- Disc (%) 1
discpct2 double precision, -- Disc (%) 2
discpct3 double precision, -- Disc (%) 3
disc1 double precision, -- Disc 1
disc2 double precision, -- Disc 2
disc3 double precision, -- Disc 3
hargapermeter double precision, -- Harga Jual Awal
stringdiskon character varying(100),
totaldiskon double precision DEFAULT 0,
tahap integer,
hargapertahun double precision,
hargaperbulan double precision,
hargaperhari double precision,
tahun integer,
bulan integer,
hari integer,
netamounttotal double precision,
pemakaiid character varying,
iddeposit character varying,
genfitout character varying(1),
iddepositfitout character varying,
depositfitout double precision,
lineupdate integer,
rpdp double precision,
ispending character varying,
idttd character varying DEFAULT ''::character varying,
netamountpajak double precision DEFAULT 0,
tipesvc character varying(1) DEFAULT ''::character varying,
tipesewa character varying(1) DEFAULT ''::character varying,
hargapermeterhari double precision DEFAULT 0,
totalhari integer DEFAULT 0,
note character varying DEFAULT ''::character varying,
iddepositsewa character varying,
geninvdepsewa character varying,
depositsewa double precision,
CONSTRAINT jadwal0_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE jadwal0
OWNER TO postgres;
COMMENT ON TABLE jadwal0
IS 'Kontrak';
COMMENT ON COLUMN jadwal0.id IS 'Kode';
COMMENT ON COLUMN jadwal0.noso IS 'NOSO';
COMMENT ON COLUMN jadwal0.tanggal IS 'Tanggal';
COMMENT ON COLUMN jadwal0.tgl_mulai IS 'Tanggal Mulai';
COMMENT ON COLUMN jadwal0.tgl_selesai IS 'Tanggal Selesai';
COMMENT ON COLUMN jadwal0.cicilan IS 'Cicilan';
COMMENT ON COLUMN jadwal0.netamount IS 'Total';
COMMENT ON COLUMN jadwal0.customerid IS 'Customer';
COMMENT ON COLUMN jadwal0.customeriddescr IS 'Customer';
COMMENT ON COLUMN jadwal0.descr IS 'Keterangan';
COMMENT ON COLUMN jadwal0.deposit IS 'Deposit';
COMMENT ON COLUMN jadwal0.geninvdep IS 'Buat Tagihan Deposit? (S/Y)';
COMMENT ON COLUMN jadwal0.luas IS 'Luas Unit';
COMMENT ON COLUMN jadwal0.tglfitting IS 'Tgl Fitting Out';
COMMENT ON COLUMN jadwal0.toko IS 'Nama Toko';
COMMENT ON COLUMN jadwal0.jenisusaha IS 'Jenis Usaha';
COMMENT ON COLUMN jadwal0.notaris IS 'Nama Notaris';
COMMENT ON COLUMN jadwal0.pemakaiiddescr IS 'Pemakai';
COMMENT ON COLUMN jadwal0.tgl_mulai_pakai IS 'Tgl Mulai Pakai';
COMMENT ON COLUMN jadwal0.tgl_selesai_pakai IS 'Tgl Selesai Pakai';
COMMENT ON COLUMN jadwal0.salesid IS 'Sales';
COMMENT ON COLUMN jadwal0.salesiddescr IS 'Sales';
COMMENT ON COLUMN jadwal0.pajakid IS 'PPN';
COMMENT ON COLUMN jadwal0.pajakiddescr IS 'PPN';
COMMENT ON COLUMN jadwal0.pphid IS 'PPH';
COMMENT ON COLUMN jadwal0.pphiddescr IS 'PPH';
COMMENT ON COLUMN jadwal0.dp IS 'DP (Cicilan)';
COMMENT ON COLUMN jadwal0.pctdp IS 'DP (Persen)';
COMMENT ON COLUMN jadwal0.tipe IS 'Tipe';
COMMENT ON COLUMN jadwal0.bf IS 'Booking Fee';
COMMENT ON COLUMN jadwal0.approveby IS 'Disetujui Oleh';
COMMENT ON COLUMN jadwal0.approvedate IS 'Disetujui Tanggal';
COMMENT ON COLUMN jadwal0.cicilanid IS 'Metode Pembayaran';
COMMENT ON COLUMN jadwal0.updatedescr IS 'Alasan Update';
COMMENT ON COLUMN jadwal0.discpct1 IS 'Disc (%) 1';
COMMENT ON COLUMN jadwal0.discpct2 IS 'Disc (%) 2';
COMMENT ON COLUMN jadwal0.discpct3 IS 'Disc (%) 3';
COMMENT ON COLUMN jadwal0.disc1 IS 'Disc 1';
COMMENT ON COLUMN jadwal0.disc2 IS 'Disc 2';
COMMENT ON COLUMN jadwal0.disc3 IS 'Disc 3';
COMMENT ON COLUMN jadwal0.hargapermeter IS 'Harga Jual Awal';



ini Java Codenya spru1.jsp

Code:
<%@page import="java.util.*,java.sql.*,java.text.*,Data.*,Util.*,Data.*" %><%
Calendar cal = Calendar.getInstance();
String periode; String sqlTime1; String sqlTime2; String title; String sql; String where; String filter;
periode = " " + Formats.cvtDate(cal.getTime(),"N");
sqlTime1 = "" + Formats.cvtDatetoYMD(cal.getTime(),"Y") + "";
sqlTime2 = "" + Formats.cvtDatetoYMD(cal.getTime(),"Y") + "";
periode += " s/d " + Formats.cvtDate(cal.getTime(),"N") ;
//End Common
String client;
if (request.getParameter("client") != ""){
client = " and jadwal0.client = '" + request.getParameter("client") + "' ";
filter="Client = " + request.getParameter("client");
}else{
client = "";
filter="";}

String divisi="";

String nos;
if (request.getParameter("nos") != ""){
nos = " '" + request.getParameter("nos").toUpperCase() + "' ";
filter=filter + " NOS = " + request.getParameter("nos");
}else{
nos = "";
filter=filter+"";}

String descr;
if (request.getParameter("descr") != ""){
descr = " and jadwal0.customeriddescr like '%" + request.getParameter("descr").toUpperCase() + "%' ";
filter=filter + " Customer = " + request.getParameter("descr");
}else{
descr = "";
filter=filter+"";}

String nis;
if (request.getParameter("nis") != ""){
nis = " and jadwal0.descr = '" + request.getParameter("nis").toUpperCase() + "%' ";
filter=filter + " Unit = " + request.getParameter("nis");
}else{
nis = "";
filter=filter+"";}

title = "Laporan Buku Bank";
Connection cn = DataUtil.getConnection();
printparam params = new printparam();
params.setConnection(cn);
params.setparam3(nos + nis + descr);
//params.setparam3(nos);
params.setcompany(session.getAttribute("company").toString());
params.setusername(session.getAttribute("user").toString());
params.setfilter(filter);
params.setperiode("");
params.setparam1("");
params.setparam2("");
params.setdivisi("");
params.setclient(request.getParameter("client"));


int id = new RunNumberRpt().getNewNumber("rpt",cn);
params.setid(id);
params.insert();
cn.close();
RequestDispatcher rdp;
rdp = request.getRequestDispatcher("/list?report=spru&format="+request.getParameter("format")+"¶mid="+id); // Dispatch to destination
rdp.forward(request, response);
%>


mgkin ada agan yg bisa bantu ... hehehe
itu syntax sql query nya salah nak
code / query snippet nya piye tho
Quote:


hehehe... maaf gan

mksudnya error code nya sperti ini,
[HELP] saya baru belajar java & postgresql, ada eror ,ada yg bisa bantu ??

mgkin agan bisa bantu? heheheemoticon-Toast emoticon-Jempol
KASKUS Ads
Quote:


ah elah.. gua dah tau itu error code nya..
kalo SQL yang mau dijalanin kayak gimana + java code nya
Quote:



hehehe.. SQL code nya begini gan

Code:


-- Table: jadwal0

-- DROP TABLE jadwal0;

CREATE TABLE jadwal0
(
id character varying(50) NOT NULL, -- Kode
createby character varying(10),
created date,
updateby character varying(10),
updated date,
client character varying(3),
divisi character varying(3),
isactive character varying(1),
noso character varying(15), -- NOSO
tanggal date, -- Tanggal
tgl_mulai date NOT NULL, -- Tanggal Mulai
tgl_selesai date NOT NULL, -- Tanggal Selesai
cicilan integer NOT NULL, -- Cicilan
refjurnal character varying(15),
isprinted character varying(1) NOT NULL,
netamount double precision, -- Total
customerid character varying(15) NOT NULL, -- Customer
customeriddescr character varying(50) NOT NULL, -- Customer
descr character varying(150) NOT NULL DEFAULT ''::character varying, -- Keterangan
deposit double precision, -- Deposit
geninvdep character(1), -- Buat Tagihan Deposit? (S/Y)
luas double precision DEFAULT 0, -- Luas Unit
tglfitting date, -- Tgl Fitting Out
toko character varying(250), -- Nama Toko
jenisusaha character varying(200), -- Jenis Usaha
notaris character varying(50), -- Nama Notaris
pemakaiiddescr character varying(50), -- Pemakai
tgl_mulai_pakai date, -- Tgl Mulai Pakai
tgl_selesai_pakai date, -- Tgl Selesai Pakai
salesid character varying(15) NOT NULL DEFAULT ''::character varying, -- Sales
salesiddescr character varying(50) NOT NULL DEFAULT ''::character varying, -- Sales
pajakid character varying(15) NOT NULL DEFAULT ''::character varying, -- PPN
pajakiddescr character varying(50) NOT NULL DEFAULT ''::character varying, -- PPN
pphid character varying(15) NOT NULL DEFAULT ''::character varying, -- PPH
pphiddescr character varying(50) NOT NULL DEFAULT ''::character varying, -- PPH
dp integer NOT NULL DEFAULT 0, -- DP (Cicilan)
pctdp double precision NOT NULL DEFAULT 0, -- DP (Persen)
tipe character varying(3) DEFAULT 'RTL'::character varying, -- Tipe
bf double precision NOT NULL DEFAULT 0, -- Booking Fee
approveby character varying(11) DEFAULT ''::character varying, -- Disetujui Oleh
approvedate date, -- Disetujui Tanggal
approvecreate character(1),
approveupdate character(1),
cicilanid character varying(15), -- Metode Pembayaran
updatedescr character varying(50) NOT NULL DEFAULT ''::character varying, -- Alasan Update
discpct1 double precision, -- Disc (%) 1
discpct2 double precision, -- Disc (%) 2
discpct3 double precision, -- Disc (%) 3
disc1 double precision, -- Disc 1
disc2 double precision, -- Disc 2
disc3 double precision, -- Disc 3
hargapermeter double precision, -- Harga Jual Awal
stringdiskon character varying(100),
totaldiskon double precision DEFAULT 0,
tahap integer,
hargapertahun double precision,
hargaperbulan double precision,
hargaperhari double precision,
tahun integer,
bulan integer,
hari integer,
netamounttotal double precision,
pemakaiid character varying,
iddeposit character varying,
genfitout character varying(1),
iddepositfitout character varying,
depositfitout double precision,
lineupdate integer,
rpdp double precision,
ispending character varying,
idttd character varying DEFAULT ''::character varying,
netamountpajak double precision DEFAULT 0,
tipesvc character varying(1) DEFAULT ''::character varying,
tipesewa character varying(1) DEFAULT ''::character varying,
hargapermeterhari double precision DEFAULT 0,
totalhari integer DEFAULT 0,
note character varying DEFAULT ''::character varying,
iddepositsewa character varying,
geninvdepsewa character varying,
depositsewa double precision,
CONSTRAINT jadwal0_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE jadwal0
OWNER TO postgres;
COMMENT ON TABLE jadwal0
IS 'Kontrak';
COMMENT ON COLUMN jadwal0.id IS 'Kode';
COMMENT ON COLUMN jadwal0.noso IS 'NOSO';
COMMENT ON COLUMN jadwal0.tanggal IS 'Tanggal';
COMMENT ON COLUMN jadwal0.tgl_mulai IS 'Tanggal Mulai';
COMMENT ON COLUMN jadwal0.tgl_selesai IS 'Tanggal Selesai';
COMMENT ON COLUMN jadwal0.cicilan IS 'Cicilan';
COMMENT ON COLUMN jadwal0.netamount IS 'Total';
COMMENT ON COLUMN jadwal0.customerid IS 'Customer';
COMMENT ON COLUMN jadwal0.customeriddescr IS 'Customer';
COMMENT ON COLUMN jadwal0.descr IS 'Keterangan';
COMMENT ON COLUMN jadwal0.deposit IS 'Deposit';
COMMENT ON COLUMN jadwal0.geninvdep IS 'Buat Tagihan Deposit? (S/Y)';
COMMENT ON COLUMN jadwal0.luas IS 'Luas Unit';
COMMENT ON COLUMN jadwal0.tglfitting IS 'Tgl Fitting Out';
COMMENT ON COLUMN jadwal0.toko IS 'Nama Toko';
COMMENT ON COLUMN jadwal0.jenisusaha IS 'Jenis Usaha';
COMMENT ON COLUMN jadwal0.notaris IS 'Nama Notaris';
COMMENT ON COLUMN jadwal0.pemakaiiddescr IS 'Pemakai';
COMMENT ON COLUMN jadwal0.tgl_mulai_pakai IS 'Tgl Mulai Pakai';
COMMENT ON COLUMN jadwal0.tgl_selesai_pakai IS 'Tgl Selesai Pakai';
COMMENT ON COLUMN jadwal0.salesid IS 'Sales';
COMMENT ON COLUMN jadwal0.salesiddescr IS 'Sales';
COMMENT ON COLUMN jadwal0.pajakid IS 'PPN';
COMMENT ON COLUMN jadwal0.pajakiddescr IS 'PPN';
COMMENT ON COLUMN jadwal0.pphid IS 'PPH';
COMMENT ON COLUMN jadwal0.pphiddescr IS 'PPH';
COMMENT ON COLUMN jadwal0.dp IS 'DP (Cicilan)';
COMMENT ON COLUMN jadwal0.pctdp IS 'DP (Persen)';
COMMENT ON COLUMN jadwal0.tipe IS 'Tipe';
COMMENT ON COLUMN jadwal0.bf IS 'Booking Fee';
COMMENT ON COLUMN jadwal0.approveby IS 'Disetujui Oleh';
COMMENT ON COLUMN jadwal0.approvedate IS 'Disetujui Tanggal';
COMMENT ON COLUMN jadwal0.cicilanid IS 'Metode Pembayaran';
COMMENT ON COLUMN jadwal0.updatedescr IS 'Alasan Update';
COMMENT ON COLUMN jadwal0.discpct1 IS 'Disc (%) 1';
COMMENT ON COLUMN jadwal0.discpct2 IS 'Disc (%) 2';
COMMENT ON COLUMN jadwal0.discpct3 IS 'Disc (%) 3';
COMMENT ON COLUMN jadwal0.disc1 IS 'Disc 1';
COMMENT ON COLUMN jadwal0.disc2 IS 'Disc 2';
COMMENT ON COLUMN jadwal0.disc3 IS 'Disc 3';
COMMENT ON COLUMN jadwal0.hargapermeter IS 'Harga Jual Awal';





Trus ini JAVA Codenya gan , spru1.jsp

Code:


<%@page import="java.util.*,java.sql.*,java.text.*,Data.*,Util.*,Data.*" %><%
Calendar cal = Calendar.getInstance();
String periode; String sqlTime1; String sqlTime2; String title; String sql; String where; String filter;
periode = " " + Formats.cvtDate(cal.getTime(),"N");
sqlTime1 = "" + Formats.cvtDatetoYMD(cal.getTime(),"Y") + "";
sqlTime2 = "" + Formats.cvtDatetoYMD(cal.getTime(),"Y") + "";
periode += " s/d " + Formats.cvtDate(cal.getTime(),"N") ;
//End Common
String client;
if (request.getParameter("client") != ""){
client = " and jadwal0.client = '" + request.getParameter("client") + "' ";
filter="Client = " + request.getParameter("client");
}else{
client = "";
filter="";}

String divisi="";

String nos;
if (request.getParameter("nos") != ""){
nos = " '" + request.getParameter("nos").toUpperCase() + "' ";
filter=filter + " NOS = " + request.getParameter("nos");
}else{
nos = "";
filter=filter+"";}

String descr;
if (request.getParameter("descr") != ""){
descr = " and jadwal0.customeriddescr like '%" + request.getParameter("descr").toUpperCase() + "%' ";
filter=filter + " Customer = " + request.getParameter("descr");
}else{
descr = "";
filter=filter+"";}

String nis;
if (request.getParameter("nis") != ""){
nis = " and jadwal0.descr = '" + request.getParameter("nis").toUpperCase() + "%' ";
filter=filter + " Unit = " + request.getParameter("nis");
}else{
nis = "";
filter=filter+"";}

title = "Laporan Buku Bank";
Connection cn = DataUtil.getConnection();
printparam params = new printparam();
params.setConnection(cn);
params.setparam3(nos + nis + descr);
//params.setparam3(nos);
params.setcompany(session.getAttribute("company").toString());
params.setusername(session.getAttribute("user").toString());
params.setfilter(filter);
params.setperiode("");
params.setparam1("");
params.setparam2("");
params.setdivisi("");
params.setclient(request.getParameter("client"));


int id = new RunNumberRpt().getNewNumber("rpt",cn);
params.setid(id);
params.insert();
cn.close();
RequestDispatcher rdp;
rdp = request.getRequestDispatcher("/list?report=spru&format="+request.getParameter("format")+"¶mid="+id); // Dispatch to destination
rdp.forward(request, response);
%>





Mohon bantuanya ya gan... hehehe emoticon-Big Grin emoticon-Jempol emoticon-Toast
Quote:


huakakaka.. query builder nya ribet banget.. gak bisa dibikin simple ya ?
yang jelas SQL query string hasil tambal sulam itu bikin error karena syntax nya salah..
coba output ke console atau ke jsp nya aja itu query string nya.
dah gitu copas, coba jalanin di pgadmin. emoticon-Toast
Quote:


tak ubah codingnya, udah gk muncul eror gan, tapi cuma tampilan blank putih gitu doang gan, gk ada tulisan apapun

trus saya check di terminal tomcat nya, ada pesan erornya begini gan
[HELP] saya baru belajar java & postgresql, ada eror ,ada yg bisa bantu ??

tapi saya check di directorynya ada kog file jpeg yg namanya logosp001.jpg

kog bisa gitu ya emoticon-Big Grin , bantuanya gan.. emoticon-Big Grin
Quote:


yakin ? bener gak... itu di atas di c:\xampp\tomcat..
di bawah langsung c:\tomcat.. dan ada yang subdir di ROOT.. ada ROOT1.. super sekali emoticon-Leh Uga
aneh.. ngapain ada tomcat di XAMPP ?
image-url-apps
Quote:


ohhh iya gan.. itu saya install xampp udah include tomcat jg.. jd itu tomcat bawaan xampp tak pake biar gk mubadzir.. hehehe

klo root1 itu default dr tomcat, saya rename dr root ke root1
biar root nya saya pakai progrm java nya gan.. hehe

bener juga gan.. lokasin directory ny ada yg beda..hehe tak coba & check dlu gan ..
Quote:


hehehe... thankyou gan... problem solved nie saya rubah directorynya

hehehe terima kasih mastah,, .. emoticon-Toast
emoticon-Blue Guy Cendol (L) emoticon-Blue Guy Cendol (L) emoticon-Blue Guy Cendol (L)
Quote:


emoticon-Toast
Artificial Intelligence (AI) Seminars for Programmers & Future AI Scientists

Hi awesome people!

Kali ini Evolve Machine Learners mau mengadakan AI seminars series nihh dengan tema dan tanggal sebagai berikut:

AI in Energy Sector: Tuesday, June 5th 2018. D-Lab EV Hive.
AI and Internet of Things (IoT): Wednesday, June 6th 2018. EV Hive City.
Creative Destruction of AI: Thursday, June 7th 2018. EV Hive City.

Take your first step of becoming AI&ML engineers and join us for the AI seminars series on,

Date : Tuesday - Thursday, June 5th - 7th 2018
Venue : D-Lab EV Hive (for tuesday only) and EV Hive City Plaza Kuningan
Time : 18.30 (Open Gate) - Drop

Kamu bisa mendaftar ke satu atau beberapa seminar melalui link berikut:
1. http://bit.ly/AIEnergySector
2. http://bit.ly/InternetofThingsSeminar
3. http://bit.ly/CreativeDestructionAI

Don't forget to checkout our social media:
1. Facebook Page : Evolve Machine Learners, Indonesia
2. Instagram : @evolvemlearners.id
3. Website : www.evolvemachinelearners.com

For further info and updates, you can ask us directly through WhatsApp on:
(+62)87786565550
×