This file contains hidden or 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
package mvcproject; | |
import javax.swing.SwingUtilities; | |
public class Main { | |
public static void main(String[] args) { | |
SwingUtilities.invokeLater(new Runnable() { | |
@Override |
This file contains hidden or 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
package mvcproject; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
public class Controller { | |
private Model model; | |
private View view; | |
private ActionListener actionListener; |
This file contains hidden or 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
public class View { | |
private JFrame frame; | |
private JLabel label; | |
private JButton button; | |
public View(String text){ | |
frame = new JFrame("View"); | |
frame.getContentPane().setLayout(new BorderLayout()); | |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
This file contains hidden or 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
package mvcproject; | |
public class Model { | |
private int Apple; | |
public Model(){ | |
Apple=0; | |
} | |
This file contains hidden or 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
public Void getid(){ | |
String result=""; | |
InputStream isr=null; | |
JSONObject jObj = null; | |
try{ | |
HttpClient httpClient=new DefaultHttpClient(); | |
HttpPost httpPost=new HttpPost("http://10.0.2.2:8080/my%20project/first.php"); | |
List<NameValuePair> nameValuePairs1 = new ArrayList<NameValuePair>(1); |
This file contains hidden or 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
TextView t; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_my); | |
t=(TextView)findViewById(R.id.textView); | |
StrictMode.enableDefaults(); | |
} |
This file contains hidden or 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
<?php $conn=odbc_connect('firstsql','sa','krishan'); | |
if (!$conn) { exit("Connection Failed: " . $conn); } | |
$rs=odbc_exec($conn,"SELECT name FROM Dept "); | |
if (!$rs) {exit("Error in SQL");} | |
//retreive data into array | |
$data = array(); | |
$i=0; | |
while( $row = odbc_fetch_array($rs) ) { | |
$data[$i] = $row; |
This file contains hidden or 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
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); |
This file contains hidden or 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
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; |
This file contains hidden or 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
<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> |
NewerOlder