Monday, October 19, 2009

Oracle JDBC NullPointerException

Got an interesting Oracle JDBC error with Oracle 10.2.0.4 database and thin JDBC driver. I invoked the method java.sql.Statement.setFetchSize(20000) on a java.sql.PreparedStatement object, and when I invoked the executeQuery() method on the object, I got the following stack trace:


java.lang.NullPointerException
at oracle.jdbc.driver.DBConversion._CHARBytesToJavaChars(DBConversion.java:974)
at oracle.jdbc.driver.DBConversion.CHARBytesToJavaChars(DBConversion.java:892)
at oracle.jdbc.driver.T4CCharAccessor.unmarshalOneRow(T4CCharAccessor.java:199)
at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:919)
at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:843)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:630)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1072)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:854)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1154)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3415)
at MyOracleProgram.invokeQuery(MyOracleProgram.java:682)


Well I tried setting the value to be 1000 for the parameter:
setFetchSize(1000)
and problem solved!

The default FetchSize for this version of Oracle appears to be 10, and if you know you will usually be getting back more than 10 rows, by all means set it to to a higher value, but if you try something bigger than 1,000 be careful!



Judging from the name of the method oracle.jdbc.driver.DBConversion._CHARBytesToJavaChars(DBConversion.java:974) in the stack trace, I bet there is a array for the result set with a hard-coded maximum array size of something bigger than 1000, but less than 20000. It would be nice if the oracle jdbc driver would catch this.



Update: Oracle support noticed I was using the ojdbc14.jar file and using Java JDK 1.6; I had to get the ojdbc6.jar file from the Oracle 11.2 JDBC distribution which is certified for JDK 1.6. Works just fine now, with Oracle 10.2 database, and JDK 1.6.

Saturday, September 26, 2009

Health care costs out of control: Solution 3: Don't rush

In the rush to get a health care bill into law, a single amendment to it by Senator Debbie Stabenow was passed by a voice vote. Then later the Only after the amendment passed did the Congressional Budget Office realize it made a mistake in the scoring and under counted the one amendment to the tune of $600 million.

Quoting from the above link "It took Senator John Cornyn (R-TX) to point it out. And now he is offering an amendment of his own to make sure this does not happen again." Basically he suggested congress couldn't vote on something until it had been publicly available for a certain amount of time. His amendment was defeated. Where is the transparency at that the leaders claim this health care reform will have, if no one can look at the proposed law?

Even more telling, is that senators are willing to force Medicaid on those who can't afford it, but are unwilling to accept the same coverage themselves if this bill passes! The New York Times details this unwillingness to be subject to themselves, what they think is good for all us.

Wednesday, September 9, 2009

Health care costs out of control: Solution 2: Be informed

Read both sides of the issue.

Senator John Cornyn asks some good questions in this commentary on Forbes.com. He mentions everyday Americans are reading the proposed bill H.R. 3200 (text) (PDF), so hey, before I make brash statements about what it will or won't do, I have some light reading to do.

And for a good book on President Obama's health care reform, check out the book Howard Dean's Prescription for Real Healthcare Reform (and glance at my review). I learned a lot about some of the advantages of the proposed reform.

Update: Here's a good starting place to look at the most recent proposals of the Senate version, at a Wall Street Journal blog on health care. 564 amendments to it already! Who could possibly keep up with all this? And what is scary is that this bill will be a long-term change to everything; good or bad; so I think that we need to put more thought into fixing something that took 40 years to go bad, and not try to fix it in 40 days.

The economy is currently far too fragile to risk something this big and costly.

Monday, September 7, 2009

Health care costs out of control: Solution 1

Wash your hands. And ensure your health-care professionals do too.

One of the most dreaded and dangerous staph infection is Methicillin-resistant Staphylococcus aureus or MRSA. It is difficult to kill this bacteria, and infections can be deadly. And often it is transmitted by health care workers who don't wash their hands between patients.

Treating such infections is extremely costly; often requiring a return hospital visit. A recent study showed a 50% drop in the number of cases of MRSA simply by having what amounts to "hand-washing cops" reminding any staff members of the rules to wash their hands if they were seen leaving a patient room without washing their hands. Compliance rates went up from 50% to 90%.

Saturday, July 25, 2009

Health care costs out of control: Symptom 1

Here is a symptom of our health care crisis. The U.S. government wants to expand health care coverage with a government program. It will undoubtedly will be similar to Medicare; and Medicare is rife with cost overruns and problems. President Obama's first quick "fix" was to suggest cutting reimbursement amounts to doctors. Gee, that would cut costs, but how many more doctors will stop accepting Medicare patients? At least he is also proposing cuts on procedures, and increase payments to primary care physicians. But cutting payments to specialists will limit access to those specialists

My mother fell when visiting me a couple years ago, and cracked her pelvis. She had Medicare. The hospital did a fine job, and recommended a followup visit with an orthopedic doctor. I had to call around to finally find one that accepted Medicare. I was less than impressed with the doctor. He asked how she was doing, and asked her to move her legs, but that was it. No physical exam, no x-rays taken, and I'm not sure he even looked at the x-rays taken at the hospital. He probably didn't have time. And when the doctor was asking my mom some questions, at one point, she didn't respond. He repeated the question louder; still no response. Again he asked, then she answered. He didn't ask if she had heard him, and didn't ask me if that had happened before. In hindsight, it appears she was having a transient ischemic attack (TIA - a mini-stroke) or maybe an absence seizure. But he was too busy to worry about that!

So the solution to health care is to cut reimbursements to doctors?

Friday, July 24, 2009

Health care costs out of control: Reason 1.

I plan on listing some things that cause health care costs to be out of control.

This first one is just a minor thing, but I'm sure it happens a lot; adding up to significant waste. I ordered a refill for a prescription through the mail-order pharmacy my company has contracted with. I printed off the order number. A few days later, the refill order disappeared. So I had to call them, and they resubmitted the refill. So what's the waste?

Only problem is, is that I will run out of medicine before the refill arrives. The pharmacy phone rep's solution? Call the doctor and ask for a prescription for a temporary supply! So I will
  • Have to call the doctor's office, tie up the receptionist for 5 minutes
  • Then the doctor has to take 10 minutes to pull the chart, and possibly call me, to ask why I need a temporary supply, assuming the receptionist didn't bother to write down why I need the prescription.
  • Then the doctor's office staff has to fax the prescription to the local pharmacy.
  • The local pharmacy will probably need to call the mail-order pharmacy for an override code, since I've had the mail-order refill order placed.
  • The local pharmacy files an on-line claim
  • The local pharmacy fills the prescription
  • I have to drive to the pharmacy, burning fossil fuel on the way

Saturday, May 9, 2009

Turn-by-turn photos - Airport Terminals?

One nice thing Google did with their driving directions lately, was to integrate their street-level images with the driving directions, so that if you aren't familiar with an intersection, you can just click on the Camera icon and see a picture of the intersection. Sweet!

Now what would be nice, if there was such a thing for airport terminals: If I arrive in Concourse C in BWI airport, and want to see how to get to baggage claim. Sure, there is a terminal map available, but there are two maps; upper and lower level. It doesn't show where the escalators are; just the elevators. What do the carosels look like? Do they have digital signs listing the flights?

I'd be grateful if someone happens to travel that way could snap some pictures!

Wednesday, April 8, 2009

The local WalMart Neighborhood Store (the smaller 42,000 square foot mini-grocery/walmart units) near me recently got rid of their 30 minute photo lab and replaced it with ... books and magazines! They retained the kiosks for ordering prints from digital memory sticks and Photo CDs. Getting rid of film processing and replacing it with another medium that is going to a certain death is kinda bizarre. I wonder what they'll replace the book section with when books stop selling; maybe a VHS video rental?

Thursday, February 26, 2009

U.S. Government ads promoting Marriage on Facebook

Well $5 million of our U.S. taxpayer dollars are going to ads promoting marriage. I think that's a good thing–marriage, that is. I'm wondering whether that is the best advertising angle. I can just see a twenty-something web surfer saying:
Hmmm, there's an ad saying to get married, maybe I will!

The web site http://www.thetwoofus.org that is part of the campaign is really quite a good resource, including articles such as 5 Ways To Find Time For Your Spouse.


Wednesday, February 18, 2009

Foreclosure Follies

I heard on the radio today an interview with a couple in Arizona that was glad there was going to be government help to help them and others avoid foreclosure. They said they owed $200,000 more their house was worth! Well, there is a prime example of a house that should be foreclosed, and the bank and the people should have to pay the penalty for their excesses, not the government, and we taxpayers that honor our obligations and rein in our expenditures.

In order for that couple to have a loan so much higher than the value, let's assume they lost 40% of their home's value, and also assume they just recently bought the house with nothing down, to make the math easy. So they bought a one-half million dollar house probably. Seems like that is a lot more house than anyone would need; I'd hate to see what the monthly payments are. Surely the bank should shoulder part of the responsibility to allow consumers to take on such a horrendous debt load.

Thursday, February 5, 2009

Economic Stimulus Debacle

I'm worried about this economy stimulus bill that appears ready to pass - too much spending on "this might help" projects (schools, health care, alternative fuels), and not enough on more certain items. I felt pretty comfortable with the first financial industry bailout but seems that those steps didn't help. And those banks that got the money basically told us taxpayers that they didn't have to account for how they spent the money! At least President Obama put a reasonable cap on executive pay.

I would've thought that we learned our lesson on investing huge sums of money on alternative fuels with the corn to ethanol fiasco. Scientists kept saying it wasn't economical, but the politicians wouldn't listen, and we saw food prices rise dramatically, since corn was being diverted from the food supply to ethanol production. It got so bad that some hog farmers had to start including stale twinkies and other snack food in the hog food as corn was too expensive. So why risk more billions poured down the drain? Alternative energy research is important, but not at such a huge amount.

Runaway government spending is just as responsible for the current meltdown as the financial sector's shenanigans. I keep hearing about all the different companies and lobbyists heading to Washington D.C. to get their "fair share" of the handouts.

Wednesday, February 4, 2009

I love the IRS

What? The agency that many Americans fear? And it is not because I expect a big refund like some do. In fact, I know the smaller your refund, the better, since you didn't loan the government (through payroll deductions that are too high) interest free.

The Internal Revenue Service does a great job, especially with the byzantine rules that congress enacts. Have you noticed if you download a 1040 tax form in PDF format, you can not only type your information into the forms, but you can save the data? Usually a person would have to have the professional version of Acrobat to save data in the form, but the IRS has appeared to license that ability for its forms.

And new this year, you can file your return electronically for free regardless of income level, if you feel comfortable not having a software program walk you through each step. It's called Free File Fillable Tax Forms. Just fill out the forms on-line, and it will do the math too. You need to look up the tax on the tax table, but it is pretty slick. The actual site is not an IRS site. I've used the old style free file sites in past years and I hated the nagging they did to try to sign me up for the "premier" version.

One tax year I had a pretty complex return, and I ended up with a $1 (one dollar!) refund. I saved the check just for fun to show off; suitable for framing. Well, the IRS noticed I didn't cash my refund check, so they increased my refund check the next year by that $1!

Friday, January 30, 2009

2 Things I thought I wouldn't have - a cell phone and a blog

I thought I'd never have a cell phone; and I held out until last year, 2008. I realized that if the car broke down somewhere, there wasn't likely to be a payphone nearby. Especially since AT&T exited the payphone business that year. So I bought a pre-paid cell phone. And I found out how useful it was to be able to make a phone call any time, almost anywhere. Stuck at an airport? On a bus? No problem. And now with Google's Android mobile phone operating system, you can do all kinds of cool stuff, including things I wish I could do with a PC-based web browser.

Now blogging. Something I thought I would never do. But I think I'm so full of interesting ideas and wisdom, that maybe someone might find it of value. Or not! I plan on spouting ideas on the economic meltdown, sound financial advice, and maybe a lot of "I remember when..." like this:
  • I remember when Xerox copy machines first came out; they produced a negative image, and cost 25 cents each at the library.
  • I remember when cross-over SUVs were called station wagons.