Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 28th, 2004, 10:16 AM
Printisor Printisor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 Printisor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Accessing database through a midlet using servlets

Hello

I'm tring to develope a midlet that connects to a database through a servlet but i just can seem to get it right.
Cand someone please write a simple exemple so that I could see how it is supposed to work.

Thank you a lot

Regards,
Michael

Reply With Quote
  #2  
Old September 28th, 2004, 12:39 PM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 15
Do a google search for it.

-KM-

Reply With Quote
  #3  
Old September 28th, 2004, 03:43 PM
Printisor Printisor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 Printisor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you for your response..

It doesn't matter no more for I have succeded with my application. It works like a charm.

Regards,
Michael

Reply With Quote
  #4  
Old November 2nd, 2004, 02:30 AM
londy84 londy84 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 3 londy84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
J2ME (Midlet) with Databases

Quote:
Originally Posted by Printisor
Thank you for your response..

It doesn't matter no more for I have succeded with my application. It works like a charm.

Regards,
Michael

Good People

I'm trying to implement the Music on demand Application. The application have to Play Music, Download and save Music Files (Which I think it can work with two data storage with the original files stored at one Databases and downloaded to another Databases by Copying from the first one and INSERTING to the second Database).

But my problem is that I'm new to J2ME Environment though I've managed to Develop the prototype (only the GUI's).

MAY YOU PLEASE ASSIST ME IF YOU KNOW HOW TO CONNECT TO DATABASE USNG J2ME AND STORING AND RETRIEVING MUSIC FILES.


May you pls send me the snippest of Code for connecting to Databases.

PLEASE ASSIST IN THIS REGARD,
Thanks in advance for your flowing responses!!!
Londy



Reply With Quote
  #5  
Old November 2nd, 2004, 05:39 AM
Printisor Printisor is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 Printisor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello

This is the code that you execute in the servlet:

Statement stmt = null;
ResultSet rs = null;
Connection con = null;
try {
Class.forName("com.microsoft.jdbc.sqlserver. SQLServerDriver").newInstance();
con= DriverManager.getConnection(URL);
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT * FROM Table1");

// Read the data, a line at a time
boolean hasEntries = false;
while (rs.next()) {
hasEntries = true;
out.println(...);
...
}

In the servlet you might have something like this:
content= new String(userName.getString()+","+password.
getString());
String result = ServletWrite.write(SERVLETURL + "?
action=write", content);
where ServletWrite is a class that writes to a OutputStream the 'content' and reads from a InputStream the results returned from the servlet. So the write method in this class should return a String representing the results read from the servlet.

Hope it helps

Regards,
Michael

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Accessing database through a midlet using servlets


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap