Yea, stop thinking about your failures. Start afresh, move on. It's hard to break it to your parents, but it's better if you tell them yourself so they wouldn't be taken by shock when they hear it from the teacher. When they're in a really good mood, slowly bring it up and really show them that you're upset, and you really wanna try hard.
Also, I'd say study really hard for the next one, but first, examine your study habits. I always go, omg, I could've done way better on this if I'd studied, oh well, I will try harder next time and really study hard.
I end up spacing out in class, skipping homework, and vice versa. I actually end up sitting on I-F instead most of the time
So, really, sit down, think it over, and even though it sounds kinda lame, form a new study style, a schedule, force yourself to study, and study hard. Study as if it's the hardest thing in the world. And when you get to the exam, it won't be. But seriously, study really hard, and force yourself to not get distracted, if you do, pinch yourself and remind yourself that if you don't study, you might possibly do bad again, and you really don't want to disappoint your parents this time.
About the teacher hating you, well, take this: I've always been a teacher's pet, but this year there's this new teacher at my new school that doesn't seem to fancy me much. And of course, it gets to me. She favors some people over another, and I've stopped letting it bother me. I just try to work hard and impress her, and look straight at her while she gives a lecture, so she knows that I'm dedicated to her class and focused on her lecture. She's turned out to be really nice, these days she smiles at me and asks me how I'm doing in my other classes, etc.