1 / 18

J2ME Form Nesneleri

J2ME Form Nesneleri. Melih Sakarya. Connection. HttpConnection InputConnection OutputConnection DatagramConnection StreamConnection Socket Connection lari Web Servisleri. HttpConnection. HtppConnection conn=(HtppConnection )Connector.open(URL);. HttpConnection.

Download Presentation

J2ME Form Nesneleri

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. J2MEForm Nesneleri Melih Sakarya

  2. Connection HttpConnection InputConnection OutputConnection DatagramConnection StreamConnection Socket Connection lari Web Servisleri

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

  4. 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");

  5. 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();

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

  7. StreamConnection StreamConnection conn=(StreamConnection )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();

  8. Sunucu Tarafi <%@ page contentType="text/html;charset=windows-1254"%> <% out.println(“Ekrana Bas”); %>

  9. Tomcat Kurulumu

  10. 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();

  11. Sunucu Tarafi <%@ page contentType="text/html;charset=windows-1254"%> <% String okulNo=“”+request.getParameter(“okulNo”); if(okulNo.equals(“111”)){ out.println(“Selam Melih”); } %>

  12. Veritabanindan Sorgulama <%@ page import="java.sql.*" %> <% 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(); %>

  13. 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);

  14. 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);

  15. SORULAR ???

More Related