Skip to content

Instantly share code, notes, and snippets.

View Krishanx92's full-sized avatar
🎯
Focusing

Krishanx92

🎯
Focusing
  • WSO2
  • SriLanka
  • 03:50 (UTC -12:00)
  • LinkedIn in/wkrishan
View GitHub Profile
<?php
header("Access-Control-Allow-Origin: *");
$mysql_host = "localhost:3306";
$mysql_database = "FirstDB";
$mysql_user = "root";
$mysql_password = "";
// Create connection
$conn = new mysqli($mysql_host, $mysql_user, $mysql_password,$mysql_database);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
var app = angular.module('starter', ['ionic']);
app.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
var app = angular.module('starter', ['ionic']);
app.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
<ion-content>
<div ng-controller="customersCtrl">
<ul>
<li ng-repeat="x in names">
{{ x.Username }}
{{ x.Password }}
</li>
</ul>
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div><h1>Employee:::</h1></div>
<br/>
<a href="insertrecord.html">Insert Record</a><br/>
import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
public class DatabaseConnection {
Connection conn;
Statement stmt;
ResultSet res;
public DatabaseConnection(){
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="InsertData" method="post">
<table>
<tr><td>UserName</td>
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, SQLException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
dbconn=new DatabaseConnection();
conn=dbconn.setConnection();
stmt=conn.createStatement();
query="select * from emp ;";
res =dbconn.getResult(query, conn);