Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5f2cab4

Browse files
adding intial project
0 parents commit 5f2cab4

File tree

6 files changed

+83
-0
lines changed

6 files changed

+83
-0
lines changed

‎.vscode/settings.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"java.project.referencedLibraries": [
3+
"lib/**/*.jar",
4+
"c:\\Users\\Aman maurya\\Downloads\\mysql-connector-java-5.1.1.jar",
5+
"c:\\Users\\Aman maurya\\Downloads\\mysql-connector-j-8.0.32.jar"
6+
]
7+
}

‎Myjdbc.class‎

1.7 KB
Binary file not shown.

‎Myjdbc.java‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
import java.sql.*;
3+
4+
5+
6+
public class Myjdbc {
7+
8+
public static void main(String[] args) {
9+
10+
try{
11+
Class.forName("com.mysql.jdbc.Driver");
12+
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/nietdb", "root", "Amsan@2003");
13+
Statement stmt = con.createStatement();
14+
ResultSet rs = stmt.executeQuery("select * from login");
15+
while(rs.next())
16+
System.out.println(rs.getString(1)+" "+ rs.getString(2));
17+
con.close();
18+
}
19+
20+
catch(Exception e){
21+
22+
System.out.println(e);
23+
24+
}
25+
26+
}
27+
28+
29+
30+
}

‎TBableCreation.java‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
public class TBableCreation {
2+
public static void main(String[] args) {
3+
try{
4+
Connection con;
5+
Statement s;
6+
Class.forName("com.mysql.jdbc.Driver");
7+
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/nietdb", "root", "Amsan@2003");
8+
s = con.createStatement();
9+
s.execute("create table CSESECTIONA(ename varcha(20),address varchar(20))");
10+
11+
12+
System.out.println("Table is created");
13+
14+
}
15+
catch(Exception e){
16+
System.out.println(e);
17+
}
18+
}
19+
20+
21+
}

‎insert‎

Whitespace-only changes.

‎insertElem.java‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import java.sql.*;
2+
3+
public class insertElem {
4+
5+
public static void main(String[] args) {
6+
try{
7+
Connection con;
8+
Statement s;
9+
Class.forName("com.mysql.jdbc.Driver");
10+
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/nietdb", "root", "Amsan@2003");
11+
s = con.createStatement();
12+
s.execute("create table csesecA11(sname varchar(20),rollno int,branch varchar(20))");
13+
s.execute("insert into csesecA11 values('aman',41,'cse')");
14+
s.execute("select * from csesecA11");
15+
16+
17+
System.out.println("Table is created and records are inserted");
18+
19+
}
20+
catch(Exception e){
21+
System.out.println(e);
22+
}
23+
}
24+
25+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /