-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added database schema and connectivity
- Loading branch information
Showing
7 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import java.sql.*; | ||
class DBCon | ||
{ | ||
public static void main(String args[]) | ||
{ | ||
try | ||
{ | ||
Class.forName("com.mysql.jdbc.Driver"); | ||
Connection con = DriverManager.getConnection("jdbc:mysql:///qa","root","shivhek25@mysql"); | ||
Statement stmt = con.createStatement(); | ||
stmt.executeUpdate("insert into qao values(1,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(2,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(3,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(4,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(5,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(6,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(7,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(8,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(9,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
stmt.executeUpdate("insert into qao values(10,'sdvdv','sdvd','sdfh','fsbf','rgrgg')"); | ||
con.close(); | ||
} | ||
catch(Exception e) | ||
{ | ||
System.out.println(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE DATABASE qa; | ||
USE qa; | ||
create table qao | ||
( | ||
qno int primary key, | ||
question varchar(250), | ||
option1 varchar(20), | ||
option2 varchar(20), | ||
option3 varchar(20), | ||
option4 varchar(20) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
USE qa; | ||
create table ua | ||
( | ||
qno int primary key, | ||
ans varchar(20), | ||
foreign key (qno) references qao(qno) | ||
); |