Iwishi
February 6th, 2005, 04:35 PM
I'm not sure if this is the proper forum but sience i am doing programing in java i supose it is.
anyway here's some basic information on what i got here.
using java 1.4 w/ JDBC and using an access 2000 database
picture table
-picture_id
-path
-type
student table
-student_id
-firstName
-lastName
-teacher
-icon
teacher table
-teacher_id
-userName
-icon
-students
anyway i have successfuly created all three tables above in java using these following code
s.execute( "create table PICTURE ( " +
"picture_id counter not null primary key, " +
"path text unique not null, " +
"type text not null )" );
s.execute( "create table STUDENT ( " +
"student_id counter not null primary key, " +
"firstName text, " +
"lastName text )" );
s.execute( "create table TEACHER ( " +
"teacher_id counter not null primary key, " +
"userName text unique, " +
"password text, " +
"icon int, " +
"gradeLevel int, " +
"students int )" );
anyway ive been searching high and low all over the internet searching for any sort of document on SQL statement for access and the closest ive found is transcat-SQL reference and most of it seems to work but large potation refuses to work with access 2000 and for majority of my works ive been gussing and walking around in the dark. anyway i'm very stuck on this last part
what i want to do is have the icon in student and teacher table refer to the picture_id and i want to enforce that it refers only to an vaild picture_id, i think its a many to one relation, in that there can be many teacher/student with the same icon, but that each teacher/students can only have one picture
and also i want to make the students in the teacher table refers to student_id in the student table and also enforced so that it only refers to vaild student_id, this also is many to one relationship i believe, but backward, in that one teacher can have more than 1 student but that students can only have one teacher
thank you for your help
anyway here's some basic information on what i got here.
using java 1.4 w/ JDBC and using an access 2000 database
picture table
-picture_id
-path
-type
student table
-student_id
-firstName
-lastName
-teacher
-icon
teacher table
-teacher_id
-userName
-icon
-students
anyway i have successfuly created all three tables above in java using these following code
s.execute( "create table PICTURE ( " +
"picture_id counter not null primary key, " +
"path text unique not null, " +
"type text not null )" );
s.execute( "create table STUDENT ( " +
"student_id counter not null primary key, " +
"firstName text, " +
"lastName text )" );
s.execute( "create table TEACHER ( " +
"teacher_id counter not null primary key, " +
"userName text unique, " +
"password text, " +
"icon int, " +
"gradeLevel int, " +
"students int )" );
anyway ive been searching high and low all over the internet searching for any sort of document on SQL statement for access and the closest ive found is transcat-SQL reference and most of it seems to work but large potation refuses to work with access 2000 and for majority of my works ive been gussing and walking around in the dark. anyway i'm very stuck on this last part
what i want to do is have the icon in student and teacher table refer to the picture_id and i want to enforce that it refers only to an vaild picture_id, i think its a many to one relation, in that there can be many teacher/student with the same icon, but that each teacher/students can only have one picture
and also i want to make the students in the teacher table refers to student_id in the student table and also enforced so that it only refers to vaild student_id, this also is many to one relationship i believe, but backward, in that one teacher can have more than 1 student but that students can only have one teacher
thank you for your help