Presentation is loading. Please wait.

Presentation is loading. Please wait.

J2ME Form Nesneleri Melih Sakarya. Connection HttpConnectionInputConnectionOutputConnectionDatagramConnectionStreamConnection Socket Connection lari.

Similar presentations


Presentation on theme: "J2ME Form Nesneleri Melih Sakarya. Connection HttpConnectionInputConnectionOutputConnectionDatagramConnectionStreamConnection Socket Connection lari."— Presentation transcript:

1 J2ME Form Nesneleri Melih Sakarya

2

3 Connection HttpConnectionInputConnectionOutputConnectionDatagramConnectionStreamConnection Socket Connection lari Web Servisleri

4 HttpConnection HtppConnection conn=(HtppConnection )Connector.open(URL);

5 HttpConnection conn.setRequestMethod(HttpConnection.GET); conn.setRequestProperty("IF-Modified-Since", "10 Nov 2000 17:29:12 GMT"); conn.setRequestProperty("User-Agent","Profile/MIDP-1.0 Confirguration/CLDC-1.0"); conn.setRequestProperty("Content-Language", "en-CA");

6 HttpConnection HtppConnection conn=(HtppConnection )Connector.open(URL); InputStream is=conn.openInputStream(); int ch; while ((ch=is.read())!=-1) { buffer.append((char)ch);}is.close();conn.close(); String sonuc = buffer.toString();

7 StreamConnection StreamConnection conn=(StreamConnection )Connector.open(URL);

8 StreamConnection InputStream is=conn.openInputStream(); int ch; while ((ch=is.read())!=-1) { buffer.append((char)ch);}is.close();conn.close(); String sonuc = buffer.toString();

9 Sunucu Tarafi <% out.println(“Ekrana Bas”); %>

10 Tomcat Kurulumu

11 Sunucu Tarafli Sorgulama String URL=“http://www.yildiz.edu.tr/notlar.jsp?ogrenciNo=111”; HtppConnection conn=(HtppConnection )Connector.open(URL); InputStream is=conn.openInputStream(); int ch; while ((ch=is.read())!=-1) { buffer.append((char)ch);}is.close();conn.close(); String sonuc = buffer.toString();

12 Sunucu Tarafi <% String okulNo=“”+request.getParameter(“okulNo”); if(okulNo.equals(“111”)){ out.println(“Selam Melih”); }%>

13 Veritabanindan Sorgulama <% String connectionURL = "jdbc:mysql://localhost:3306/mydatabase?user=username;password=password" ; Connection connection = null; Statement statement = null; ResultSet rs = null; %><%Class.forName("org.gjt.mm.mysql.Driver").newInstance(); connection = DriverManager.getConnection(connectionURL, "", ""); statement = connection.createStatement(); rs = statement.executeQuery("SELECT * FROM ogrenciler"); while (rs.next()) { out.println(rs.getString(“ad")+” ”+rs.getString(“ad")+“\n"); }rs.close();%>

14 Belli Araliklarla Baglanma TimerTask task=new TimerTask(){ public void run(){ veriGetir();}}; Timer timer=new Timer(); timer.schedule(task,new Date(),1000); Form form=new Form(""); ticker=new Ticker(""); form.setTicker(ticker);

15 Sunucu Tarafindan Resim Getirme HttpConnection conn=(HttpConnection)Connector.open(URL); InputStream is=conn.openInputStream(); DataInputStream din=new DataInputStream(is); int length=(int)conn.getLength(); byte[] data = new byte[length]; din.readFully( data ); is.close();din.close(); Image image=Image.createImage(data,0,data.length);

16

17

18 SORULAR ???


Download ppt "J2ME Form Nesneleri Melih Sakarya. Connection HttpConnectionInputConnectionOutputConnectionDatagramConnectionStreamConnection Socket Connection lari."

Similar presentations


Ads by Google