Skip to main content

Posts

Python Evaluation Hackerrank Solution | Hackerrank Python

 Python Evaluation Hackerrank Solution For Explanation Watch Video : Code:: # Enter your code here. Read input from STDIN. Print output to STDOUT eval(input())

Draw The Triangle 2 Hackerrank Solution - SQL

 Draw The Triangle 2 Hackerrank Solution - SQL  for explanation watch video: Code:: set serveroutput on; declare res clob; begin  for i in 1..20 loop      res := '';      for j in 1..i loop        res := res || '*' || ' ';      end loop;      dbms_output.put_line(res);  end loop; end; /

Draw The Triangle 1 Hackerrank Solution - SQL

  Draw The Triangle 1 Hackerrank Solution - SQL for Explanation watch Video : Code:: set serveroutput on; declare res clob; begin for i in reverse 1..20 loop res := ''; for j in 1..i loop res := res || '*' || ' '; end loop; dbms_output.put_line(res); end loop; end; /

Print Prime Numbers Hackerrank Solution - PL/SQL

 Print Prime Numbers Hackerrank Solution - PL/SQL for explanation watch video ::  Code:: set serveroutput on; declare output clob := ''; co number; begin  for i in 2..1000 loop      co := 0;      for j in 2..(i/2) loop        if mod(i,j)=0          then            co := 1;            exit;         end if;     end loop;     if co = 0      then        output :=  output || i ||'&';     end if;     end loop;     dbms_output.put_line(substr(output,1,length(output)-1)); end; /

ResultSetMetaData in java

 ResultSetMetaData in java code:; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; class Test{ public static void main(String arg[]){ try(Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","tiger"); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from stu");){ //create ResultSetMetaData obj ResultSetMetaData rsmd = rs.getMetaData(); //get column count int colCount = rsmd.getColumnCount();//3 //print column name for(int i=1;i<=colCount;i++) { System.out.print(rsmd.getColumnName(i)+" "); } System.out.println(); //for column type for(int i=1;i<=colCount;i++) { System.out.print(rsmd.getColumnTypeName(i)+" "); } System.out.println(); }catch(SQL...

JDBC Project - Log in Project With Mysql In Eclipse

JDBC Project - Log in Project With Mysql In Eclipse For explanation Watch Video :    Step 1: Create table 'login' in mysql step 2::  Insert Records Into 'login' table Step 3: Go to Eclipse and download swing related components Install Swing On Eclipse click on help at top of eclipse IDE after that click on install new software after that paste link in work with : 2020-12 - http://download.eclipse.org/releases/2020-12 i am using 2020-12 eclipse version at place of 2020-12 you can use your version name ex:: if your version of eclipse is oxygen then link : oxygen - http://download.eclipse.org/releases/oxygen expand click on general purpose tools and check the all tool from swing designer to end and after that click on  finish. After downloading all tools restart eclipse IDE. Download MySQL Jar File From here:  https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.25 for connection method:: Connection con = null; PreparedStatement ps = null; pu...

Population Density Difference Hackerrank Solution - SQL

 Population Density Difference Hackerrank Solution - SQL For Explanation Watch Video : Code::  select max(population) - min(population) from city;