Tee Morales

Greenhorn
+ Follow
since Apr 21, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Tee Morales

I am writing some JUnit test cases with HSQLDB.

I found that TO_DATE, TO_CHAR are not found in HSQLDB. Was wondering if anyone had a workaround for this. The team I am on uses HSQLDB as a test case database. But the actual Application will run against Oracle.

Any help will be appreciated.
TIA
Thanks!

I goofed up.


group = record.substring(0,9).trim();
billingUnit = record.substring(9,13).trim();
accountNumber = record.substring(13,20).trim();
enrollmentDate = record.substring(20,28).trim();
billingDate = record.substring(28,36).trim();
status = record.substring(36);
}
15 years ago
Hi All,
Getting this error. I ran it through the debugger and I see that it is taking an error on the second field billingUnit = record.substring(9,4);. See how the String is greater than the substring I am indexing. I don't understand how it is taking such an error.


10:22:24.158 COL I main: *************** Exception occurred **************
10:22:24.158 COL I main: toString: java.lang.StringIndexOutOfBoundsException: String index out of range: -5
10:22:24.158 COL I main:
10:22:24.158 COL I main: getMessage: String index out of range: -5
10:22:24.158 COL I main:
10:22:24.158 COL I main: StackTrace:
java.lang.StringIndexOutOfBoundsException: String index out of range: -5


groupSORDateExtract = new GroupSORDate(detailSORExtract);


public class GroupSORDate {

private String group = null;
private String billingUnit = null;
private String accountNumber = null;
private String enrollmentDate = null;
private String billingDate = null;
private String status = null;


public GroupSORDate(String record) {
group = record.substring(0,9);
billingUnit = record.substring(9,4);
accountNumber = record.substring(13,7);
enrollmentDate = record.substring(20,8);
billingDate = record.substring(28,8);
status = record.substring(36);
}

Record:

tctttt tttttctttt 0101200904202009R




15 years ago