Select statement to find record in JDBC
hi there. here are my tables.
LorryDetails
LorryID
LorryReg
Capacity
Capacity_remaining
Position
PlaceOrder
OrderId
Destination
CustomerId
Quantity
Distance
Source (with values Cavan,Athlone,Dublin,Galway in it)
Cavan (with values 0 , 70 , 90 , 130 in it)
Athlone (with values 70 , 0 , 120 , 60 in it)
Dublin (with values 90, 120 , 0 , 180 in it)
Galway ( WITH values 130, 60 , 180, 0 in it)
I want to Select the LorryDEtails where the Position of the Lorry is the same as the Destination chosen in the PlaseOrder table. it must also check to see that lorries capacity_remaining is greater than the Quantity chosen. If any of these conditions ar not true i want it to find the nearest Lorry maybe by using the Distance table. Im not sure if anyone has an easier way feel free to tell me.
Sorry if this seems very long and complicated. Any help would be very grateful. Thanks for looking at my problem. Look forward to hearing from ye.
I want to Select the LorryDEtails where the Position
of the Lorry is the same as the Destination chosen in
the PlaseOrder table. it must also check to see that
lorries capacity_remaining is greater than the
Quantity chosen.
SELECT a.* FROM LorryDetails a, PlaceOrder b
WHERE a.Position = b.Destination
AND a.Capacity_remaining > b.QuantityThe other part is for you to solve.
Similar Messages
-
Use of LIKE in where clause of select statement for multiple records
Hi Experts,
I have a account number field which is uploaded from a file. Now this account numbers uploaded does not match fully with sap table account numbers but it contains all of the numbers provided in the file mostly in the upright positions.
For example in file we have account number as 2ARS1 while in sap table the value is 002ARS1.
And i want to fetch data from sap table based on account number uploaded. So, i am trying to use LIKE with for all entries but its not working as mentioned below but LIKE is not working with FOR ALL ENTRIES.
data : begin of t_dda occurs 0,
dda(19) type c,
end of t_dda.
data : begin of t_bukrs occurs 0,
bukrs type t012k-bukrs,
end of t_bukrs.
data : dda type t012k-bankn,
w_dda type t012k-bankn.
CONCATENATE '%'
'2ARS1'
INTO W_DDA.
MOVE W_DDA TO T_DDA-DDA.
APPEND T_DDA.
CLEAR T_DDA.
free t_bukrs.
SELECT BUKRS
FROM T012K
into TABLE t_bukrs
for all entries in t_dda
WHERE BANKN like t_dda-dda.
Can anybody suggest what should i use to get the data for multiple account numbers using one select statement only instead on using SELECT UP TO 1 ROWS in LOOP....ENDLOOP ?
Thanks in advance,
AkashHi,
yes, For All entries won't work for LIKE with '% '.
I think the other alternative is go for Native SQL by writing sub-query
sample code is here:
data: begin of i_mara occurs 0,
matnr like mara-matnr,
matkl like mara-matkl,
end of i_mara.
exec sql.
select matnr, matkl from mara where matnr in (select matnr from marc) and matnr like '%ma' into :i_mara
endexec.
loop at i_mara.
write:/ i_mara-matnr, i_mara-matkl.
endloop.
hope u got it.
regards
Mahesh
Edited by: Mahesh Reddy on Jan 21, 2009 2:32 PM -
Can select statement return 'No Record found' for each of invalid inputs.
Let say when you select a invalid booking number, oracle will
return nothing, but do u know how to make oracle return a record
saying it's invalid?
Example, the following sql normally return 3 records cause
only 3 numbers are valid, is there anyway to make it return
4 records and indicate those invalid ones are invalid somehow.
select booking_service, BOOKING_NO from tb_booking where booking_no in ('valid1','INVALID', 'valid2', 'valid3')Along the same lines you could use object types to achieve the same result. This would remove the need for a temporary table, and also allow you to create the list of ids to check with PL/SQL without i/o. As an example
CREATE TYPE booking_id_typ IS OBJECT (id NUMBER);
CREATE TYPE booking_id_list_typ IS TABLE OF booking_id_typ;
CREATE TABLE bookings (booking_id booking_id_typ);
(you could have booking_id as type NUMBER, but for consistency with subsequent SQL I've used booking_id_typ)
INSERT INTO bookings VALUES (booking_id_typ(10));
INSERT INTO bookings VALUES (booking_id_typ(20));
INSERT INTO bookings VALUES (booking_id_typ(40));
INSERT INTO bookings VALUES (booking_id_typ(50));
The following SQL statement creates a collection on the fly, rather than using an IN clause.
SELECT i.id booking_id, DECODE(b.booking_id.id, NULL, 'Invalid', 'Ok') status
FROM bookings b,
SELECT id
FROM TABLE(booking_id_list_typ(booking_id_typ(10), booking_id_typ(20), booking_id_typ(30), booking_id_typ(40)))
) i
WHERE i.id = b.booking_id.id (+)
BOOKING_ID STATUS
10 Ok
20 Ok
30 Invalid
40 Ok
This SQL statement works in 9i. I get the following error in 8i, but you might be able to CAST the TABLE to booking_id_list_typ, or depending on your application, create a PL/SQL variable of type booking_id_list_typ and CAST that instead.
ERROR at line 5:
ORA-22905: cannot access rows from a non-nested table item -
Select statement to find the balace qty as per fabricator/supplier
Hi all
I have five tables belongs to this query
i need supplier wise report how much i recieve from supplier and how much i issue to that supplier
and hw much is pending to a particular supplier
SQL> desc supplier
Name Null? Type
CODE VARCHAR2(10)
NAME VARCHAR2(100)
ADDRESS VARCHAR2(255)
TIN_NUMBER VARCHAR2(25)
CONTACT_PERSON VARCHAR2(100)
CONTACT_NUMBER VARCHAR2(50)
PARTY_TYPE VARCHAR2(20)
SQL> desc grn
Name Null? Type
ID NUMBER
REC_DATE DATE
DOC_NUMBER VARCHAR2(20)
DOC_DATE DATE
SUPPLIER_CODE VARCHAR2(10)
TOTAL_VAL NUMBER
PURCHASE_BY VARCHAR2(20)
RECEIVE_BY VARCHAR2(20)
ITEM_TYPE VARCHAR2(50)
SQL> desc grn_detail1
Name Null? Type
ID NUMBER
SALE_ORDER_ID VARCHAR2(150)
PROD_ID VARCHAR2(20)
PROD_NAME VARCHAR2(100)
COLOR VARCHAR2(20)
XS NUMBER
S NUMBER
M NUMBER
L NUMBER
XL NUMBER
PCS NUMBER
COMMENT1 VARCHAR2(2000)
RAC NUMBER
QL> desc gin
Name Null? Type
ID NUMBER
ISSUE_DATE DATE
SALE_ORDER_ID VARCHAR2(150)
ISSUE_FOR VARCHAR2(2000)
SUPPLIER_CODE VARCHAR2(10)
SUPPLIER_NAME VARCHAR2(100)
ITEM_TYPE VARCHAR2(50)
SQL> desc gin_detail1
Name Null? Type
ID NUMBER
SALE_ORDER_ID VARCHAR2(150)
PROD_ID VARCHAR2(20)
PROD_NAME VARCHAR2(100)
COLOR VARCHAR2(20)
XS NUMBER
S NUMBER
M NUMBER
L NUMBER
XL NUMBER
PCS NUMBER
COMMENT1 VARCHAR2(2000)Supplier table holds the information of supplier and grn is for good receive note(master table) and grn_detail1 is detail table fror this as gin is good issue note (master table) and gin_detail1 is detail table
on the basis of these table i want to find the balace_qty of products .
as per supplier
Please Guide
Thanks And Regards
Vikas SinghalHi
SQL> SELECT gin.supplier_name,
2 SUM (gind1.xs + gind1.s + gind1.m + gind1.l + gind1.xl + gind1.pcs
3 ) AS total_issue,
4 SUM (grnd1.xs + grnd1.s + grnd1.m + grnd1.l + grnd1.xl + grnd1.pcs
5 ) AS total_receive
6 FROM gin, grn, gin_detail1 gind1, grn_detail1 grnd1
7 WHERE gin.supplier_code = grn.supplier_code
8 AND gin.ID = gind1.ID
9 AND grn.ID = grnd1.ID
10 GROUP BY gin.supplier_name;
FROM gin, grn, gin_detail1 gind1, grn_detail1 grnd1
ERROR at line 6:
ORA-01652: unable to extend temp segment by 256 in tablespace TEMPThanks For reply
Regards
Vikas
Edited by: vikas singhal on Aug 24, 2009 4:37 PM -
Need help using Select statement to retrieve one record
Hi guys, my first post so be gentle please. The basis of this fucntion is to search my dtabase using the select statement to find the record the user wants, by retrieving the name of theitem from the text box. details are then displayed on a joption message box.
Everytime I run this program it throws an exception 'Exception: null'. Can anyone see where I am going wrong, I have only bn learning java for thepast 6 months so perhaps I am doing something wrong.
Or perhaps there is another way for me to close the st, con, rs?
Your help appreciated
public void searchproducts(){
Connection con = null;
Statement st = null;
ResultSet rs = null;
try{
//creating and loading a database connection
String dbUrl = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=db2.mdb;"; // String dbUrl = "jdbc:odbc:people";
String user = "";
String password = "";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection(
dbUrl, user, password);
int count;
st = con.createStatement();
rs = st.executeQuery("SELECT ItemName, Country, Yearmade, ValuePrice, Forsale FROM Collectman WHERE ItemName="+" '"+txtsearchproduct.getText()+"'" );
while(rs.next()) {
String ItemName = rs.getString(1);
String Country = rs.getString(2);
String Yearmade = rs.getString(3);
String ValuePrice = rs.getString(4);
String Forsale = rs.getString(5);
JOptionPane.showMessageDialog(null, "product details are: " + ItemName + " " + Country + " " + Yearmade + " " + ValuePrice + " " + Forsale);
//It keeps on throwing this excpetion with null
catch (Exception e) {
System.err.println("Exception: " + e.getMessage());
} finally {
try {
if(rs != null)
rs.close();
if(st != null)
st.close();
if(con != null)
con.close();
} catch (SQLException e) {
}And while we're waiting on that, I'll just say it's nice to see you almost got the general layout of a db call correct...that's a rare thing around here. The finally should have a try/catch round each of the close statements and not around all three in one go. If the resultset throws an exception in your version then you would fail to close either the statement or the connection.
The second thing is, look up PreparedStatements. They're a better choice for handling SQL requiring variables than using a bog standard Statement. -
How to use SELECT statement to extract KNA1-NAME1 and KNB1-ZSABE
In building table I_KNA1 in form f_extract_data, an additional select statement is needed to select and append datafrom (KNA1 and KNB1) to existing I_KNA1
In form f_extract_data table i_kna1 is populated with data from zd_kna101.(where ZD_KNA101 is a view of KNA1, KNB1 and KNBK. It's a joint of these three tables.) This will take care of all customers with KNBK-BANKL and KNBK-BANLN populated. But this does not include new customers created in SAP CRM (no KNBK records). Therefore a separate SELECT statement is needed to extract KNA1-NAME1 and KNB1-ZSABE for customers created in SAP CRM(the customers who do do not have BANKL and BANKN). These selected records are then need to be appended to I_KNA1. It's possible that new selection statement might extract records that are already in existing I_KNA1 table. IF this is the case, right after the append, sort I_KNA1 and remove duplicate records.
form f_extract_data.
select kunnr " Customer Number
name1 " Name
zsabe " Business Unit
bankl " Legacy Bank Key
bankn " Legacy Bank Account
from zd_kna101 " View of KNA1, KNB1, and KNBK
into table i_kna1
for all entries in i_doc_by_ref
where kunnr = i_doc_by_ref-kunnr
and zsabe in s_zsabe.
if sy-subrc <> 0.
message a116 with 'customer'. " Customer Table is empty. HALT!!!
else.
sort i_kna1 by kunnr.
endif.
will I have to use the join statement(for KNA1-NAME1 and KNB1-ZSABE using the key as KUNNR) here or give two seperate select statements for extracting data from KNA1 and KNB1 using the key as KUNNR.
THANKS FOR THE HELP.I would suggest using the join on KUNNR. Maybe something like this.
data: begin of itab occurs 0,
kunnr type kna1-kunnr,
name1 type kna1-name1,
ZSABE type knb1-ZSABE,
end of itab.
select kna1~kunnr kna1~name1 knb1~zsabe
into table itab
from kna1
inner join knb1
on kna1~kunnr = knb1~kunnr
where ........
Regards,
Rich Heilman -
Select Statement is not working
Hi All,
I am working on Master Data Text Datasource customer exit. Reading only restricted records using select statement if it is valid then those records move into I_T_DATA. If not they are not going to read.
I have written the following code .
Data : ls_rotextstr2 TYPE ROTEXTSTR2. '' Extrct Struct Name
*&Assigning values language and chart of accounts to variables
Data : lc_zspras TYPE SKAT-SPRAS VALUE 'E',
lc_Zktopl TYPE SKAT-KTOPL VALUE 'GCOA',
lc_zsaknr TYPE SKAT-SAKNR.
LOOP AT I_T_DATA INTO ls_rotextstr2.
gi_tabix = SY-TABIX.
SELECT SINGLE SPRAS KTOPL SAKNR FROM SKAT INTO
(lc_zspras, lc_Zktopl, lc_zsaknr)
WHERE SPRAS = lc_zspras
AND KTOPL = lc_Zktopl.
IF SY-SUBRC EQ 0.
MODIFY I_T_DATA FROM ls_rotextstr2.
ENDIF.
ENDLOOP.
Here select statement reading all records like other than 'EN" and 'GCOA' and going to Subrc condition.
Please some one take a look at the programme and tell me where I am making mistake. I just want the records that are language = 'EN' and Chart of Accounts = 'GCOA'.
Your suggestions are very help full to me,
Thanks
Ganesh.Hi,
Try this..
types : begin of s,
spras type skat-spras,
ktopl type skat-ktopl,
saknr type skat-saknr,
end of s.
data i_t_data type standard table of s with header line.
Data : ls_rotextstr2 TYPE ROTEXTSTR2. " Extrct Struct Name
*&Assigning values language and chart of accounts to variables
Data : lc_zspras TYPE SKAT-SPRAS VALUE 'E',
lc_Zktopl TYPE SKAT-KTOPL VALUE 'GCOA',
lc_zsaknr TYPE SKAT-SAKNR.
*gi_tabix = SY-TABIX.
SELECT SPRAS KTOPL SAKNR FROM SKAT INTO
table i_t_data
WHERE SPRAS = lc_zspras
AND KTOPL = lc_Zktopl.
Edited by: Kamini Rawat on Mar 19, 2008 5:56 AM -
Customer Exit --- Select statement is not working
Hi All,
I am working on Master Data Text Datasource customer exit. Reading only restricted records using select statement if it is valid then those records move into I_T_DATA. If not they are not going to read.
I have written the following code .
Data : ls_rotextstr2 TYPE ROTEXTSTR2. '' Extrct Struct Name
*&Assigning values language and chart of accounts to variables
Data : lc_zspras TYPE SKAT-SPRAS VALUE 'E',
lc_Zktopl TYPE SKAT-KTOPL VALUE 'GCOA',
lc_zsaknr TYPE SKAT-SAKNR.
LOOP AT I_T_DATA INTO ls_rotextstr2.
gi_tabix = SY-TABIX.
SELECT SINGLE SPRAS KTOPL SAKNR FROM SKAT INTO
(lc_zspras, lc_Zktopl, lc_zsaknr)
WHERE SPRAS = lc_zspras
AND KTOPL = lc_Zktopl.
IF SY-SUBRC EQ 0.
MODIFY I_T_DATA FROM ls_rotextstr2.
ENDIF.
ENDLOOP.
Here select statement reading all records like other than 'EN" and 'GCOA' and going to Subrc condition.
Please some one take a look at the programme and tell me where I am making mistake. I just want the records that are language = 'EN' and Chart of Accounts = 'GCOA'.
Your suggestions are very help full to me,
Thanks
Ganesh.Hi,
Apply the following changes :
Data : ls_rotextstr2 TYPE ROTEXTSTR2. '' Extrct Struct Name
Data : lc_zspras TYPE SKAT-SPRAS VALUE 'E',
lc_Zktopl TYPE SKAT-KTOPL VALUE 'GCOA',
lc_zsaknr TYPE SKAT-SAKNR.
LOOP AT I_T_DATA INTO ls_rotextstr2.
gi_tabix = SY-TABIX.
SELECT SINGLE SPRAS KTOPL SAKNR FROM SKAT INTO
(lc_zspras, lc_Zktopl, lc_zsaknr)
WHERE SPRAS = lc_zspras
AND KTOPL = lc_Zktopl.
IF SY-SUBRC NE 0.
DELETE I_T_DATA INDEX gi_tabix.
CONTINUE.
ENDIF.
ENDLOOP.
hope it works...
regards,
Raju -
Concatenation in select statement ?
I need some help from you people. I need to write a select statement, and in the WHERE condition I need to compare the table field with concatenation of two fields ( say F1 and F2) which I already determined.
And I need to do this for say 1 million set of field combinations of F1 and F2. I can write a loop before the select statement and find all the concatenations of F1 and F2 . But I want to make it less time consuming.
Please let me know how to do this.
ThanksWhy not use a range. Add all of the combinations to the range and then use the range in your Select statement.
Something like this.
report zrich_0003.
TYPes: begin of trange,
value(30) type c,
end of trange.
data: xrange type trange.
ranges: r_range for xrange.
r_range-sign = 'I'.
r_range-option = 'EQ'.
concatanate 'A' 'B' into r_range-low.
append r_range.
r_range-sign = 'I'.
r_range-option = 'EQ'.
concatanate 'C' 'D' into r_range-low.
append r_range.
r_range-sign = 'I'.
r_range-option = 'EQ'.
concatanate 'E' 'F' into r_range-low.
append r_range.
Select * into itable from ztable
where some_field in r_range.
Regards,
Rich Heilman -
How to optimize this select statement its a simple select....
how to optimize this select statement as the records in earlier table is abt i million
and this simplet select statement is not executing and taking lot of time
SELECT guid
stcts
INTO table gt_corcts
FROM corcts
FOR all entries in gt_mege
WHERE /sapsll/corcts~stcts = gt_mege-ctsex
and /sapsll/corcts~guid_pobj = gt_Sagmeld-guid_pobj.
regards
AroraHi Arora,
Using Package size is very simple and you can avoid the time out and as well as the problem because of memory. Some time if you have too many records in the internal table, then you will get a short dump called TSV_TNEW_PAGE_ALLOC_FAILED.
Below is the sample code.
DATA p_size = 50000
SELECT field1 field2 field3
INTO TABLE itab1 PACKAGE SIZE p_size
FROM dtab
WHERE <condition>
Other logic or process on the internal table itab1
FREE itab1.
ENDSELECT.
Here the only problem is you have to put the ENDSELECT.
How it works
In the first select it will select 50000 records ( or the p_size you gave). That will be in the internal table itab1.
In the second select it will clear the 50000 records already there and append next 50000 records from the database table.
So care should be taken to do all the logic or process with in select and endselect.
Some ABAP standards may not allow you to use select-endselect. But this is the best way to handle huge data without short dumps and memory related problems.
I am using this approach. My data is much more huge than yours. At an average of atleast 5 millions records per select.
Good luck and hope this help you.
Regards,
Kasthuri Rangan Srinivasan -
I have a select statement that pulls records from one table, if they are equal to the same field in another table. What I want to do as well is be able to still show a record even if it is not equal to the second table, is there an except statement or selecting something that is suppressed. Thanks
RalphI probably did not explain what I exactly I was looking for.
Let say I have "John, Paul, and Robert" in a report that is pulling there names from a survey table that links back to a TASKS table where it shows who completed the work. Well John and Robert are no longer with the company. In order to deselect there names We compare the TASKS table name field to the NAME.STAF table because we update that to show current staff with the company. However now the manager says that we want to keep Roberts survey results and still include him on the report but no one else. How can I still exclude everytone not in the STAF table, but then include "Robert" in the report when he is not in that table.
Thanks
Ralph -
How to find the number of fetched lines from select statement
Hi Experts,
Can you tell me how to find the number of fetched lines from select statements..
and one more thing is can you tell me how to check the written select statement or written statement is correct or not????
Thanks in advance
santoshHi,
Look for the system field SY_TABIX. That will contain the number of records which have been put into an internal table through a select statement.
For ex:
data: itab type mara occurs 0 with header line.
Select * from mara into table itab.
Write: Sy-tabix.
This will give you the number of entries that has been selected.
I am not sure what you mean by the second question. If you can let me know what you need then we might have a solution.
Hope this helps,
Sudhi
Message was edited by:
Sudhindra Chandrashekar -
Help! Crashing JVM while doing SELECT statement through JDBC-ODBC bridge
Hi everyone,
Help please. I am working on a project on my own computer using the jdk version 1.5.0_04.
The project involves running a select on a Microsoft Access 2003 database via the JDBC-ODBC bridge. The database is registered in the ODBC database sources, and it works fine in those other projects.
Yet, when I'm running similar code in this project, it crashes the Java Virtual Machine. I get the following in a log file:
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c901010, pid=2308, tid=1364
# Java VM: Java HotSpot(TM) Client VM (1.5.0_04-b05 mixed mode, sharing)
# Problematic frame:
# C [ntdll.dll+0x1010]
--------------- T H R E A D ---------------
Current thread (0x000360f8): JavaThread "main" [_thread_in_native, id=1364]
siginfo: ExceptionCode=0xc0000005, reading address 0x00000018
Registers:
EAX=0x00000004, EBX=0x26bb5250, ECX=0x7ffde000, EDX=0x00000004
ESP=0x0007f8d8, EBP=0x0007f8f0, ESI=0x00000000, EDI=0x02ea1590
EIP=0x7c901010, EFLAGS=0x00010246
Top of Stack: (sp=0x0007f8d8)
0x0007f8d8: 74355a16 00000004 02ea15b4 7432139f
0x0007f8e8: 02ea15b4 02ea1590 0007f900 74322c5d
0x0007f8f8: 02ea15b4 000361b4 0007f914 74325fa0
0x0007f908: 02ea1590 74350000 00390000 0007f930
0x0007f918: 7432740e 02ea1590 0007f950 00000003
0x0007f928: 00aabe20 000361b4 0007f948 6d3e11da
0x0007f938: 02ea1590 0007f950 000360f8 26bb5250
0x0007f948: 0007f980 00ad826f 00000000 0007f99c
Instructions: (pc=0x7c901010)
0x7c901000: 90 90 90 90 90 64 8b 0d 18 00 00 00 8b 54 24 04
0x7c901010: 83 7a 14 00 75 4f f0 ff 42 04 75 19 8b 41 24 89
Stack: [0x00040000,0x00080000), sp=0x0007f8d8, free space=254k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [ntdll.dll+0x1010]
C [ODBC32.dll+0x2c5d]
C [ODBC32.dll+0x5fa0]
C [ODBC32.dll+0x740e]
C [JdbcOdbc.dll+0x11da]
j sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
j sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
j sun.jdbc.odbc.JdbcOdbcConnection.createStatement(II)Ljava/sql/Statement;+27
j sun.jdbc.odbc.JdbcOdbcConnection.createStatement()Ljava/sql/Statement;+7
j LUDatabaseWorker.getBoxScoreFromDB(LStatisticalItems/BoxScore;)LStatisticalItems/BoxScore;+215
j NewUSCHOLiveUpdate.processTheBoxScores()V+78
j NewUSCHOLiveUpdate.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub
V [jvm.dll+0x82696]
V [jvm.dll+0xd6fd9]
V [jvm.dll+0x82567]
V [jvm.dll+0x895e6]
C [java.exe+0x14c0]
C [java.exe+0x64cd]
C [kernel32.dll+0x16d4f]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j sun.jdbc.odbc.JdbcOdbc.allocStmt(J[B)J+0
j sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(J)J+47
j sun.jdbc.odbc.JdbcOdbcConnection.createStatement(II)Ljava/sql/Statement;+27
j sun.jdbc.odbc.JdbcOdbcConnection.createStatement()Ljava/sql/Statement;+7
j LUDatabaseWorker.getBoxScoreFromDB(LStatisticalItems/BoxScore;)LStatisticalItems/BoxScore;+215
j NewUSCHOLiveUpdate.processTheBoxScores()V+78
j NewUSCHOLiveUpdate.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00a6e550 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2240]
0x00a6d258 JavaThread "CompilerThread0" daemon [_thread_blocked, id=736]
0x00a6c440 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2252]
0x00a47808 JavaThread "Finalizer" daemon [_thread_blocked, id=3352]
0x00a46328 JavaThread "Reference Handler" daemon [_thread_blocked, id=1560]
=>0x000360f8 JavaThread "main" [_thread_in_native, id=1364]
Other Threads:
0x00a67a68 VMThread [id=2700]
0x00a6f8c8 WatcherThread [id=2480]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 576K, used 404K [0x22b90000, 0x22c30000, 0x23070000)
eden space 512K, 70% used [0x22b90000, 0x22bea738, 0x22c10000)
from space 64K, 66% used [0x22c20000, 0x22c2a990, 0x22c30000)
to space 64K, 0% used [0x22c10000, 0x22c10000, 0x22c20000)
tenured generation total 1408K, used 846K [0x23070000, 0x231d0000, 0x26b90000)
the space 1408K, 60% used [0x23070000, 0x231438e0, 0x23143a00, 0x231d0000)
compacting perm gen total 8192K, used 507K [0x26b90000, 0x27390000, 0x2ab90000)
the space 8192K, 6% used [0x26b90000, 0x26c0ed38, 0x26c0ee00, 0x27390000)
ro space 8192K, 66% used [0x2ab90000, 0x2b0e9dc0, 0x2b0e9e00, 0x2b390000)
rw space 12288K, 46% used [0x2b390000, 0x2b927e98, 0x2b928000, 0x2bf90000)
Dynamic libraries:
0x00400000 - 0x0040c000 C:\jdk1.5.0_04\bin\java.exe
0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
0x6d6b0000 - 0x6d839000 C:\jdk1.5.0_04\jre\bin\client\jvm.dll
0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f56000 C:\WINDOWS\system32\GDI32.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x629c0000 - 0x629c9000 C:\WINDOWS\system32\LPK.DLL
0x74d90000 - 0x74dfb000 C:\WINDOWS\system32\USP10.dll
0x6d2f0000 - 0x6d2f8000 C:\jdk1.5.0_04\jre\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x6d680000 - 0x6d68c000 C:\jdk1.5.0_04\jre\bin\verify.dll
0x6d370000 - 0x6d38d000 C:\jdk1.5.0_04\jre\bin\java.dll
0x6d6a0000 - 0x6d6af000 C:\jdk1.5.0_04\jre\bin\zip.dll
0x6d3e0000 - 0x6d3ed000 C:\jdk1.5.0_04\jre\bin\JdbcOdbc.dll
0x74320000 - 0x7435d000 C:\WINDOWS\system32\ODBC32.dll
0x5d090000 - 0x5d127000 C:\WINDOWS\system32\COMCTL32.dll
0x7c9c0000 - 0x7d1d5000 C:\WINDOWS\system32\SHELL32.dll
0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
0x763b0000 - 0x763f9000 C:\WINDOWS\system32\comdlg32.dll
0x773d0000 - 0x774d2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
0x20000000 - 0x20017000 C:\WINDOWS\system32\odbcint.dll
0x774e0000 - 0x7761d000 C:\WINDOWS\system32\ole32.dll
0x77120000 - 0x771ac000 C:\WINDOWS\system32\OLEAUT32.dll
0x77fe0000 - 0x77ff1000 C:\WINDOWS\system32\Secur32.dll
0x76fd0000 - 0x7704f000 C:\WINDOWS\system32\CLBCATQ.DLL
0x77050000 - 0x77115000 C:\WINDOWS\system32\COMRes.dll
0x77c00000 - 0x77c08000 C:\WINDOWS\system32\VERSION.dll
0x0f9a0000 - 0x0f9ab000 C:\WINDOWS\system32\VBAJET32.DLL
0x5ad70000 - 0x5ada8000 C:\WINDOWS\system32\uxtheme.dll
VM Arguments:
java_command: NewUSCHOLiveUpdate
Environment Variables:
JAVA_HOME=C:\jdk1.5.0_04
CLASSPATH=C:\jdk1.5.0_04\bin\NewLiveUpdate;C:\jdk1.5.0_04\bin\NewLiveUpdate\StatisticalItems;C:\jdk1.5.0_04\bin\NewLiveUpdate\Exceptions;C:\jdk1.5.0_04\bin\NewLiveUpdate\Helper;
PATH=C:\jdk1.5.0_04\bin;C:\JavaTools\ant\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;;c:\program files\devstudio\sharedide\bin\ide;c:\program files\devstudio\sharedide\bin;c:\program files\devstudio\vc\bin
USERNAME=Kevin Yetman
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows XP Build 2600 Service Pack 2
CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht
Memory: 4k page, physical 1047020k(627436k free), swap 2518436k(2161900k free)
vm_info: Java HotSpot(TM) Client VM (1.5.0_04-b05) for windows-x86, built on Jun 3 2005 02:10:41 by "java_re" with MS VC++ 6.0
The code that is causing the problem is in the class shown below. It is in the method getBoxScoreFromDB. When it attempts to run the first select statement, it causes the crash that I showed above.
The connection is set up by the calling class. The calling class constructs a LUDatabaseWorker, sets the necessary parameters (dbURL, driver class, username and password), and calls the openDBConnection().
// LUDatabaseWorker.java
import StatisticalItems.*;
import java.sql.*;
import java.util.*;
public class LUDatabaseWorker
private StatisticalItems.BoxScore m_CurrentBoxScoreInDB;
private Connection m_Connection;
private String m_dbURL;
private String m_dbUsername;
private String m_dbPassword;
private String m_dbDriverClass;
public LUDatabaseWorker()
public StatisticalItems.BoxScore getCurrentBoxScoreInDB()
{ return m_CurrentBoxScoreInDB;
public void setDBURL(String dbURL)
{ m_dbURL=new String(dbURL);
public void setDBUsername(String dbUsername)
{ m_dbUsername=new String(dbUsername);
public void setDBPassword(String dbPassword)
{ m_dbPassword=new String(dbPassword);
public void setDBDriverClass(String dbDriverClass)
{ m_dbDriverClass=new String(dbDriverClass);
public void openDBConnection()
throws SQLException, ClassNotFoundException
Class.forName(m_dbDriverClass);
m_Connection=DriverManager.getConnection(m_dbURL, m_dbUsername, m_dbPassword);
public void closeDBConnection()
throws SQLException
m_Connection.close();
public Hashtable<String, Integer> getUSCHOCodeToMyTeamIndexMap()
throws SQLException
Hashtable<String, Integer> ht=new Hashtable<String, Integer>();
String sqlQuery="SELECT TeamIndex, TeamCode FROM TeamLiveUpdateUSCHO";
Statement st=m_Connection.createStatement();
ResultSet rs=st.executeQuery(sqlQuery);
while(rs.next())
String uschoCode=new String(rs.getString(2));
Integer myTeamIndex=new Integer(rs.getInt(1));
ht.put(uschoCode, myTeamIndex);
rs.close();
st.close();
return ht;
public StatisticalItems.BoxScore getBoxScoreFromDB(StatisticalItems.BoxScore luBoxScore)
throws SQLException
StatisticalItems.BoxScore boxScoreFromDB=new StatisticalItems.BoxScore();
// get the basic game info from the live update box score.
StatisticalItems.Game luBasicGameData=luBoxScore.getBasicGameData();
// get the basic game data.
String sqlQuery="SELECT * FROM Game WHERE (Year=" + luBasicGameData.getYear() + ") AND (Month='";
if( luBasicGameData.getMonth() < 10 )
{ sqlQuery+="0";
sqlQuery+=luBasicGameData.getMonth() + "') AND (Day='";
if( luBasicGameData.getDay() < 10 )
{ sqlQuery+="0";
sqlQuery+=luBasicGameData.getDay() + "') AND (HomeTeamIndex=" + luBasicGameData.getHomeTeamIndex();
sqlQuery+=") AND (VisitorTeamIndex=" + luBasicGameData.getVisitorTeamIndex() + ")";
System.out.println(sqlQuery);
Statement st=m_Connection.createStatement();
ResultSet rs=st.executeQuery(sqlQuery);
if( rs.next() )
StatisticalItems.Game dbGame=boxScoreFromDB.getBasicGameData();
dbGame.setGameIndex(rs.getInt("GameIndex"));
dbGame.setHomeTeamIndex(rs.getInt("HomeTeamIndex"));
dbGame.setVisitorTeamIndex(rs.getInt("VisitorTeamIndex"));
dbGame.setHomeTeamGoals(rs.getInt("HomeTeamGoals"));
dbGame.setVisitorTeamGoals(rs.getInt("VisitorTeamGoals"));
dbGame.setHomeTeamScoredFirst(rs.getString("HomeTeamScoredFirst"));
dbGame.setYear(rs.getInt("Year"));
dbGame.setMonth(rs.getInt("Month"));
dbGame.setDay(rs.getInt("Day"));
dbGame.setLeagueGame(rs.getBoolean("LeagueGame"));
dbGame.setNeutralSiteGame(rs.getBoolean("NeutralSiteGame"));
dbGame.setForfeitHome(rs.getBoolean("ForfeitHome"));
dbGame.setForfeitVisitor(rs.getBoolean("ForfeitVisitor"));
dbGame.setPlayoffGame(rs.getBoolean("PlayoffGame"));
boxScoreFromDB.setBasicGameData(dbGame);
StatisticalItems.Game dbGame=boxScoreFromDB.getBasicGameData();
// get the home team goals per period.
sqlQuery="SELECT * FROM GameDetailGoalsPerPeriod WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
sqlQuery+="(TeamIndex=" + dbGame.getHomeTeamIndex() + ")";
rs=st.executeQuery(sqlQuery);
if( rs.next() )
StatisticalItems.GameDetailGoalsPerPeriod dbHomeGPP=boxScoreFromDB.getHomeTeamGoalsPerPeriod();
dbHomeGPP.setGameDetailGoalsPerPeriodIndex(rs.getInt("GameDetailGoalsPerPeriodIndex"));
dbHomeGPP.setGameIndex(rs.getInt("GameIndex"));
dbHomeGPP.setTeamIndex(rs.getInt("TeamIndex"));
dbHomeGPP.setPeriod1(new Integer(rs.getInt("GoalsFirstPeriod")));
dbHomeGPP.setPeriod2(new Integer(rs.getInt("GoalsSecondPeriod")));
dbHomeGPP.setPeriod3(new Integer(rs.getInt("GoalsThidPeriod")));
dbHomeGPP.setOvertime(new Integer(rs.getInt("GoalsOvertime")));
dbHomeGPP.setEmptyNetGoals(rs.getInt("EmptyNetGoals"));
dbHomeGPP.setFoundInDatabase(true);
boxScoreFromDB.setHomeTeamGoalsPerPeriod(dbHomeGPP);
// get the visitor team goals per period.
sqlQuery="SELECT * FROM GameDetailGoalsPerPeriod WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
sqlQuery+="(TeamIndex=" + dbGame.getVisitorTeamIndex() + ")";
rs=st.executeQuery(sqlQuery);
if( rs.next() )
StatisticalItems.GameDetailGoalsPerPeriod dbVisitorGPP=boxScoreFromDB.getVisitorTeamGoalsPerPeriod();
dbVisitorGPP.setGameDetailGoalsPerPeriodIndex(rs.getInt("GameDetailGoalsPerPeriodIndex"));
dbVisitorGPP.setGameIndex(rs.getInt("GameIndex"));
dbVisitorGPP.setTeamIndex(rs.getInt("TeamIndex"));
dbVisitorGPP.setPeriod1(new Integer(rs.getInt("GoalsFirstPeriod")));
dbVisitorGPP.setPeriod2(new Integer(rs.getInt("GoalsSecondPeriod")));
dbVisitorGPP.setPeriod3(new Integer(rs.getInt("GoalsThidPeriod")));
dbVisitorGPP.setOvertime(new Integer(rs.getInt("GoalsOvertime")));
dbVisitorGPP.setEmptyNetGoals(rs.getInt("EmptyNetGoals"));
dbVisitorGPP.setFoundInDatabase(true);
boxScoreFromDB.setVisitorTeamGoalsPerPeriod(dbVisitorGPP);
// get the home team shots per period.
sqlQuery="SELECT * FROM GameDetailShotsPerPeriod WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
sqlQuery+="(TeamIndex=" + dbGame.getHomeTeamIndex() + ")";
rs=st.executeQuery(sqlQuery);
if( rs.next() )
StatisticalItems.GameDetailShotsPerPeriod dbHomeSPP=boxScoreFromDB.getHomeTeamShotsPerPeriod();
dbHomeSPP.setGameDetailShotsPerPeriodIndex(rs.getInt("GameDetailShotsPerPeriodIndex"));
dbHomeSPP.setGameIndex(rs.getInt("GameIndex"));
dbHomeSPP.setTeamIndex(rs.getInt("TeamIndex"));
dbHomeSPP.setPeriod1(new Integer(rs.getInt("ShotsFirstPeriod")));
dbHomeSPP.setPeriod2(new Integer(rs.getInt("ShotsSecondPeriod")));
dbHomeSPP.setPeriod3(new Integer(rs.getInt("ShotsThidPeriod")));
dbHomeSPP.setOvertime(new Integer(rs.getInt("ShotsOvertime")));
dbHomeSPP.setFoundInDatabase(true);
boxScoreFromDB.setHomeTeamShotsPerPeriod(dbHomeSPP);
// get the visitor team shots per period.
sqlQuery="SELECT * FROM GameDetailShotsPerPeriod WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
sqlQuery+="(TeamIndex=" + dbGame.getVisitorTeamIndex() + ")";
rs=st.executeQuery(sqlQuery);
if( rs.next() )
StatisticalItems.GameDetailShotsPerPeriod dbVisitorSPP=boxScoreFromDB.getVisitorTeamShotsPerPeriod();
dbVisitorSPP.setGameDetailShotsPerPeriodIndex(rs.getInt("GameDetailShotsPerPeriodIndex"));
dbVisitorSPP.setGameIndex(rs.getInt("GameIndex"));
dbVisitorSPP.setTeamIndex(rs.getInt("TeamIndex"));
dbVisitorSPP.setPeriod1(new Integer(rs.getInt("ShotsFirstPeriod")));
dbVisitorSPP.setPeriod2(new Integer(rs.getInt("ShotsSecondPeriod")));
dbVisitorSPP.setPeriod3(new Integer(rs.getInt("ShotsThidPeriod")));
dbVisitorSPP.setOvertime(new Integer(rs.getInt("ShotsOvertime")));
dbVisitorSPP.setFoundInDatabase(true);
boxScoreFromDB.setVisitorTeamShotsPerPeriod(dbVisitorSPP);
// get the home team special teams.
sqlQuery="SELECT * FROM GameDetailSpecialTeams WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
sqlQuery+="(TeamIndex=" + dbGame.getHomeTeamIndex() + ")";
rs=st.executeQuery(sqlQuery);
if( rs.next() )
StatisticalItems.GameDetailSpecialTeams dbHomeST=boxScoreFromDB.getHomeTeamSpecialTeams();
dbHomeST.setGameDetailSpecialTeamsIndex(rs.getInt("GameDetailSpecialTeamsIndex"));
dbHomeST.setGameIndex(rs.getInt("GameIndex"));
dbHomeST.setTeamIndex(rs.getInt("TeamIndex"));
dbHomeST.setPowerplayGoals(rs.getInt("PowerPlayGoals"));
dbHomeST.setShorthandedGoals(rs.getInt("ShortHandedGoals"));
dbHomeST.setPowerplayOps(rs.getInt("PowerPlayOps"));
dbHomeST.setShorthandedOps(rs.getInt("ShortHandedOps"));
dbHomeST.setPenalties(rs.getInt("Penalties"));
dbHomeST.setPenaltyMinutes(rs.getInt("PenaltyMinutes"));
dbHomeST.setFoundInDatabase(true);
boxScoreFromDB.setHomeTeamSpecialTeams(dbHomeST);
// get the home team special teams.
sqlQuery="SELECT * FROM GameDetailSpecialTeams WHERE (GameIndex=" + dbGame.getGameIndex() + ") AND ";
sqlQuery+="(TeamIndex=" + dbGame.getVisitorTeamIndex() + ")";
rs=st.executeQuery(sqlQuery);
if( rs.next() )
StatisticalItems.GameDetailSpecialTeams dbVisitorST=boxScoreFromDB.getVisitorTeamSpecialTeams();
dbVisitorST.setGameDetailSpecialTeamsIndex(rs.getInt("GameDetailSpecialTeamsIndex"));
dbVisitorST.setGameIndex(rs.getInt("GameIndex"));
dbVisitorST.setTeamIndex(rs.getInt("TeamIndex"));
dbVisitorST.setPowerplayGoals(rs.getInt("PowerPlayGoals"));
dbVisitorST.setShorthandedGoals(rs.getInt("ShortHandedGoals"));
dbVisitorST.setPowerplayOps(rs.getInt("PowerPlayOps"));
dbVisitorST.setShorthandedOps(rs.getInt("ShortHandedOps"));
dbVisitorST.setPenalties(rs.getInt("Penalties"));
dbVisitorST.setPenaltyMinutes(rs.getInt("PenaltyMinutes"));
dbVisitorST.setFoundInDatabase(true);
boxScoreFromDB.setVisitorTeamSpecialTeams(dbVisitorST);
rs.close();
st.close();
return boxScoreFromDB;
public void updateBoxScoreInDB(StatisticalItems.BoxScore dbBoxScore,
StatisticalItems.BoxScore luBoxScore,
LUBoxScoreComparator bsc)
throws SQLException
if( bsc.getGameChanged() )
updateGameInDB(dbBoxScore, luBoxScore);
if( bsc.getHomeGoalsPerPeriodChanged() )
updateHomeGoalsPerPeriod(dbBoxScore, luBoxScore);
if( bsc.getVisitorGoalsPerPeriodChanged() )
updateVisitorGoalsPerPeriod(dbBoxScore, luBoxScore);
if( bsc.getHomeShotsPerPeriodChanged() )
updateHomeShotsPerPeriod(dbBoxScore, luBoxScore);
if( bsc.getVisitorShotsPerPeriodChanged() )
updateVisitorShotsPerPeriod(dbBoxScore, luBoxScore);
if( bsc.getHomeSpecialTeamsChanged() )
updateHomeSpecialTeams(dbBoxScore, luBoxScore);
if( bsc.getVisitorSpecialTeamsChanged() )
updateVisitorSpecialTeams(dbBoxScore, luBoxScore);
protected void updateGameInDB(StatisticalItems.BoxScore dbBoxScore,
StatisticalItems.BoxScore luBoxScore)
throws SQLException
// the only fields that NEED to be updated are HomeTeamGoals, VisitorTeamGoals, HomeTeamScoredFirst,
// and LeagueGame. You can't determine from the LU box Score:
// Forfeits, NeutralSite, or Playoff.
// the GameIndex, Both team indexes, and the game date will NEVER change from the database.
Statement st=m_Connection.createStatement();
String sqlStmt="UPDATE Game SET ";
sqlStmt+="HomeTeamGoals=" + luBoxScore.getBasicGameData().getHomeTeamGoals() + ", ";
sqlStmt+="VisitorTeamGoals=" + luBoxScore.getBasicGameData().getVisitorTeamGoals() + ", ";
sqlStmt+="HomeTeamScoredFirst='" + luBoxScore.getBasicGameData().getHomeTeamScoredFirst() + "', ";
sqlStmt+="LeagueGame=" + luBoxScore.getBasicGameData().getLeagueGame() + " ";
sqlStmt+="WHERE GameIndex=" + dbBoxScore.getBasicGameData().getGameIndex();
st.executeUpdate(sqlStmt);
st.close();
protected void updateHomeGoalsPerPeriod(StatisticalItems.BoxScore dbBoxScore,
StatisticalItems.BoxScore luBoxScore)
throws SQLException
Statement st=m_Connection.createStatement();
String sqlStmt="";
if( dbBoxScore.getHomeTeamGoalsPerPeriod().getFoundInDatabase() )
sqlStmt="UPDATE GameDetailGoalsPerPeriod SET ";
sqlStmt+="GameIndex=" + dbBoxScore.getHomeTeamGoalsPerPeriod().getGameIndex() + ", ";
sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamGoalsPerPeriod().getTeamIndex() + ", ";
sqlStmt+="GoalsFirstPeriod=" + luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod1() + ", ";
sqlStmt+="GoalsSecondPeriod=" + luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod2() + ", ";
sqlStmt+="GoalsThirdPeriod=" + luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod3() + ", ";
sqlStmt+="GoalsOvertime=" + luBoxScore.getHomeTeamGoalsPerPeriod().getOvertime() + ", ";
sqlStmt+="EmptyNetGoals=" + luBoxScore.getHomeTeamGoalsPerPeriod().getEmptyNetGoals() + " ";
sqlStmt+="WHERE GameIndex=" + dbBoxScore.getHomeTeamGoalsPerPeriod().getGameIndex() + " AND ";
sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamGoalsPerPeriod().getTeamIndex();
else
sqlStmt="INSERT INTO GameDetailGoalsPerPeriod ";
sqlStmt+="(GameIndex, TeamIndex, GoalsFirstPeriod, GoalsSecondPeriod, GoalsThirdPeriod, ";
sqlStmt+="GoalsOvertime, EmptyNetGoals) VALUES(";
sqlStmt+=dbBoxScore.getBasicGameData().getGameIndex() + ", ";
sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getTeamIndex() + ", ";
sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod1() + ", ";
sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod2() + ", ";
sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getPeriod3() + ", ";
sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getOvertime() + ", ";
sqlStmt+=luBoxScore.getHomeTeamGoalsPerPeriod().getEmptyNetGoals() + ")";
st.executeUpdate(sqlStmt);
st.close();
protected void updateVisitorGoalsPerPeriod(StatisticalItems.BoxScore dbBoxScore,
StatisticalItems.BoxScore luBoxScore)
throws SQLException
Statement st=m_Connection.createStatement();
String sqlStmt="";
if( dbBoxScore.getVisitorTeamGoalsPerPeriod().getFoundInDatabase() )
sqlStmt="UPDATE GameDetailGoalsPerPeriod SET ";
sqlStmt+="GameIndex=" + dbBoxScore.getVisitorTeamGoalsPerPeriod().getGameIndex() + ", ";
sqlStmt+="TeamIndex=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getTeamIndex() + ", ";
sqlStmt+="GoalsFirstPeriod=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod1() + ", ";
sqlStmt+="GoalsSecondPeriod=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod2() + ", ";
sqlStmt+="GoalsThirdPeriod=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod3() + ", ";
sqlStmt+="GoalsOvertime=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getOvertime() + ", ";
sqlStmt+="EmptyNetGoals=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getEmptyNetGoals() + " ";
sqlStmt+="WHERE GameIndex=" + dbBoxScore.getVisitorTeamGoalsPerPeriod().getGameIndex() + " AND ";
sqlStmt+="TeamIndex=" + luBoxScore.getVisitorTeamGoalsPerPeriod().getTeamIndex();
else
sqlStmt="INSERT INTO GameDetailGoalsPerPeriod ";
sqlStmt+="(GameIndex, TeamIndex, GoalsFirstPeriod, GoalsSecondPeriod, GoalsThirdPeriod, ";
sqlStmt+="GoalsOvertime, EmptyNetGoals) VALUES(";
sqlStmt+=dbBoxScore.getBasicGameData().getGameIndex() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getTeamIndex() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod1() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod2() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getPeriod3() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getOvertime() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamGoalsPerPeriod().getEmptyNetGoals() + ")";
st.executeUpdate(sqlStmt);
st.close();
protected void updateHomeShotsPerPeriod(StatisticalItems.BoxScore dbBoxScore,
StatisticalItems.BoxScore luBoxScore)
throws SQLException
Statement st=m_Connection.createStatement();
String sqlStmt="";
if( dbBoxScore.getHomeTeamShotsPerPeriod().getFoundInDatabase() )
sqlStmt="UPDATE GameDetailShotsPerPeriod SET ";
sqlStmt+="GameIndex=" + dbBoxScore.getHomeTeamShotsPerPeriod().getGameIndex() + ", ";
sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamShotsPerPeriod().getTeamIndex() + ", ";
sqlStmt+="ShotsFirstPeriod=" + luBoxScore.getHomeTeamShotsPerPeriod().getPeriod1() + ", ";
sqlStmt+="ShotsSecondPeriod=" + luBoxScore.getHomeTeamShotsPerPeriod().getPeriod2() + ", ";
sqlStmt+="ShotsThirdPeriod=" + luBoxScore.getHomeTeamShotsPerPeriod().getPeriod3() + ", ";
sqlStmt+="ShotsOvertime=" + luBoxScore.getHomeTeamShotsPerPeriod().getOvertime() + " ";
sqlStmt+="WHERE GameIndex=" + dbBoxScore.getHomeTeamShotsPerPeriod().getGameIndex() + " AND ";
sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamShotsPerPeriod().getTeamIndex();
else
sqlStmt="INSERT INTO GameDetailShotsPerPeriod ";
sqlStmt+="(GameIndex, TeamIndex, ShotsFirstPeriod, ShotsSecondPeriod, ShotsThirdPeriod, ";
sqlStmt+="ShotsOvertime) VALUES(";
sqlStmt+=dbBoxScore.getBasicGameData().getGameIndex() + ", ";
sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getTeamIndex() + ", ";
sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getPeriod1() + ", ";
sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getPeriod2() + ", ";
sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getPeriod3() + ", ";
sqlStmt+=luBoxScore.getHomeTeamShotsPerPeriod().getOvertime() + ")";
st.executeUpdate(sqlStmt);
st.close();
protected void updateVisitorShotsPerPeriod(StatisticalItems.BoxScore dbBoxScore,
StatisticalItems.BoxScore luBoxScore)
throws SQLException
Statement st=m_Connection.createStatement();
String sqlStmt="";
if( dbBoxScore.getVisitorTeamShotsPerPeriod().getFoundInDatabase() )
sqlStmt="UPDATE GameDetailShotsPerPeriod SET ";
sqlStmt+="GameIndex=" + dbBoxScore.getVisitorTeamShotsPerPeriod().getGameIndex() + ", ";
sqlStmt+="TeamIndex=" + luBoxScore.getVisitorTeamShotsPerPeriod().getTeamIndex() + ", ";
sqlStmt+="ShotsFirstPeriod=" + luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod1() + ", ";
sqlStmt+="ShotsSecondPeriod=" + luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod2() + ", ";
sqlStmt+="ShotsThirdPeriod=" + luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod3() + ", ";
sqlStmt+="ShotsOvertime=" + luBoxScore.getVisitorTeamShotsPerPeriod().getOvertime() + " ";
sqlStmt+="WHERE GameIndex=" + dbBoxScore.getVisitorTeamShotsPerPeriod().getGameIndex() + " AND ";
sqlStmt+="TeamIndex=" + luBoxScore.getVisitorTeamShotsPerPeriod().getTeamIndex();
else
sqlStmt="INSERT INTO GameDetailShotsPerPeriod ";
sqlStmt+="(GameIndex, TeamIndex, ShotsFirstPeriod, ShotsSecondPeriod, ShotsThirdPeriod, ";
sqlStmt+="ShotsOvertime) VALUES(";
sqlStmt+=dbBoxScore.getBasicGameData().getGameIndex() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getTeamIndex() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod1() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod2() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getPeriod3() + ", ";
sqlStmt+=luBoxScore.getVisitorTeamShotsPerPeriod().getOvertime() + ")";
st.executeUpdate(sqlStmt);
st.close();
protected void updateHomeSpecialTeams(StatisticalItems.BoxScore dbBoxScore,
StatisticalItems.BoxScore luBoxScore)
throws SQLException
Statement st=m_Connection.createStatement();
String sqlStmt="";
if( dbBoxScore.getHomeTeamSpecialTeams().getFoundInDatabase() )
sqlStmt="UPDATE GameDetailSpecialTeams SET ";
sqlStmt+="GameIndex=" + dbBoxScore.getHomeTeamSpecialTeams().getGameIndex() + ", ";
sqlStmt+="TeamIndex=" + luBoxScore.getHomeTeamSpecialTeams().getTeamIndex() + ", ";
sqlStmt+="PowerplayGoals=" + luBoxScore.getHomeTeamSpecialTeams().getPowerplayGoals() + ", ";
sqlStmt+="PowerplayOps=" + luBoxScore.getHomeTeamSpecialTeams().getPowerplayOps() + ", ";
sqlStmt+="ShorthandedGoals=" + luBoxScore.getHomeTeamSpecialTeams().getShorthandedGoals() + ", ";
sqlStmt+="ShorthandedOps=" + luBoxScore.getHomeTeamSpecialTeams().getShorthandeits because you use hungarian notation - that was the hollywood squares answer.
It looks like a bug in either the ntdll or the JdbcOdbc dll, so I'd see if you can't isolate the problem (like using a smaller bit of code) and file a bug report. Find out exacty what your sql statement is which causes this to crash - hint : line 215 -
Writing Select statement for JDBC Adapter
Dear frndz,
Please guide me, i have to pick record form the Oracle D/B,
and this has to be updated in the Sap Table. For this scenario, tell me where i have to write the select statements to fetch the particular record.I was asked to use the jdbc adapter for this d/b link.
Thanks in advance
KarthikeyanHi karthikeyan,
You have to use a sender JDBC adapter.
Just follow the instructions in this link:
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
Previously, you must install Oracle drivers so that JDBC works properly.
Regards,
Carlos -
Select statement for JDBC receiver synch scenario for capturing random value from ECC portal
Dear Experts,
I am working on ECC <----> SAP-PO 7.31 <----> JDBC synchronous scenario. I am clear about the config part except the Select statement. I will be
capturing 2 random values from the portal i.e. VendId and VendName in ECC to get the vendor details like Vendor Country, Vendor Status, Vendor Contact , Vendor Address etc from JDBC vendor table/view VENDETAIL.
What would be the select statement to capture the random values for ECC portal? My select statement would look some thing like this..
Select f1,f2,f3,f4 from table VENDETAIL where key1 = "VendId" and "VendName"
Please suggest if the above select statement works for the above scenario...
Regards
RebeccaHi Rebecca,
Your statement should work fine.
Please see the statement we use below.
SELECT eT_cashier, eT_proc_yn, eT_proc_date FROM eTest WHERE eb_proc_yn = 'N'
Just remember to update the change indicator so that you dont duplicate your records.
UPDATE eTest SET eb_proc_yn = 'Y' WHERE eb_proc_yn = 'N'.
Regards,
Jannus Botha
Maybe you are looking for
-
Cannot export slow motion w/o ghost images
Hello everyone, The home movies and video works in my computer look exactly as I want them to and they export to QuickTime perfectly in "DV Full Quality." My problem is that the movies export both to the camera and to the DVD burner with awful ghost
-
Trouble Installing CS4 on Mac Book Pro with Lion 10.7.3
Hello, I'm having trouble with this. As instructed by Adobe I'm working with the original CD to install this to my laptop. It goes up to installing Adobe Air, about half way through the whole installation and then stops. I have tried resetting the pe
-
How we can control auto start/stop of db/listener on Unix/linux?
How we can control auto start/stop of db/listener on Unix/linux?
-
Procurement using webbased catalogs
Hello everyone, we are using the OCI (Open Catalog Interface) for procurement (me51n, me21n) in an ECC 6.0 which works fine with one default catalog. Now we are looking for an solution for connecting several vendor catalogs with the SAP-system. Our o
-
For most sites, FF8 saves my login info. For some sites it will not even save my username. One site in particular, it used to be saved (I think I added it to a settings file somewhere in a previous version), but I deleted that login username, and now