Adam Compton

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

Recent posts by Adam Compton

I've changed to using a local database within NetBeans and I've almost got it to work but I'm having some issues either regarding the mapping or the way I'm using the sessionfactory.

Configuration file, I think it's working 100% now.


The database is called AnimalsDatabase:
Table: Animals
PK: id - integer
name - varchar
type - varchar

Now the thing I'm confused about is when I created the table the names were all lowercase but on the Services database explorer they come up as full CAPS.

The Mapping File:


The save method in my program:



Here are the errors:

Okay if I can't link to it from the outside is there a way I can upload the .jar file of the program to the web host and run it from there? It's a console based program.

Also can you tell me what namespace I need to implement to get getSession() to work as well for my loadDatabase method?
I'm quite new to using MySQL in Java and Hibernate, can you tell me how to do it in Netbeans 7?
I'm not sure how else to do it, the only way I can check to see if it worked is to use PHPMyAdmin on the web host site.

I have these namespaces on the class file that handles the saving and loading but I can't get the getSession() method to create queries:




Hi, I'm trying to get my program to connect to my database, I've got the connection details here:

MySQL database name: a1847282_animals
MySQL user name: a1847282_adam
Password for MySQL user: passw0rd

Table name: Animals
Field 1: animalID - int size 3
Field 2: animalName - text size 20
Field 3: animalType - text size 20

My Hibernate Config File:


My Hibernate Mapping file


My Mapping Class


Here's my code to save data to the database from a List<Animal>


Now when I try and connect I get these errors: