Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavk343 committed May 7, 2022
1 parent 5fc5fc8 commit 8688116
Show file tree
Hide file tree
Showing 16 changed files with 386 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Day 27/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Day 27/.idea/Day 27.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Day 27/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Day 27/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions Day 27/.idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Day 27/SQLAssign.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

import java.sql.*;
import java.util.Scanner;

public class SQLAssign {

public static void main(String[] args) throws Exception {
Class.forName("org.postgresql.Driver");
//System.out.println("Driver loaded");
Scanner ob = new Scanner(System.in);
System.out.println("Enter username : ");
String username = ob.next();
System.out.println("Enter password : ");
String password = ob.next();
Connection conn = DriverManager.getConnection("jdbc:postgresql:https://localhost:5432/test", username, password);
System.out.println("Connection Done!");
Statement stmt = conn.createStatement();
System.out.println("Enter query : ");
String sql = ob.next();
stmt.executeUpdate(sql);
System.out.println("Record Inserted");
conn.close();
}
}
15 changes: 15 additions & 0 deletions Day 27/SQLDemo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import java.sql.*;

public class SQLDemo {
public static void main(String[] args) throws Exception {
Class.forName("org.postgresql.Driver");
System.out.println("Driver loaded");
Connection conn = DriverManager.getConnection("jdbc:postgresql:https://localhost:5432/test","postgres","789456");
System.out.println("Connection Done!");
Statement stmt = conn.createStatement();
String sql = "insert into student values(800,'XYZ')";
stmt.executeUpdate(sql);
System.out.println("Record Inserted");
conn.close();
}
}
21 changes: 21 additions & 0 deletions Day 27/WiproExamCode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import java.util.Scanner;
public class WiproExamCode {
public static double powFirst(int input1){
String s = Integer.toString(input1);
int len = s.length();
double x = Integer.parseInt(s.charAt(0)+"");
double y = Integer.parseInt(s.charAt(len-1)+"");
double p = Math.pow(x,y);
if(x==1){
return 1;
}else{
return p;
}
}
public static void main(String[] args) {
Scanner ob = new Scanner(System.in);
int i = ob.nextInt();
double x = WiproExamCode.powFirst(i);
System.out.println(x);
}
}
3 changes: 3 additions & 0 deletions Day 27/out/production/Day 27/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Day 27/out/production/Day 27/.idea/Day 27.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Day 27/out/production/Day 27/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Day 27/out/production/Day 27/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8688116

Please sign in to comment.