You Are Here:

Community: Developer Discussion Boards

#1 Old JDBC & how to connect to a database on a web server - 2009-06-04, 10:48

Join Date: May 2009
Posts: 108
elaltaico
Offline
Regular Contributor
Hello


I want my midlet to connect to a database which is embeed on a web server. I tried to connect it by using netbeans but I could not. I can see there is JDBD:ODBC bridge loaded. I wrote my username password host database at the database section of Netbeans. But it could not connect to database. Do I Need to create a JDBC:ODBC Bridge connection which can connect to database and change url name at my code. Briefly, Could you please tell me how to write my JDBC driver's url at my code and how to establish a connection between my MIDlet and webserver? Thank you in advance..


Here are my database details :

my host : sql104.byetcluster.com
my database: freew_355634_museum
my class name :museums


Best Regards
Altai
Reply With Quote

#2 Old Re: JDBC & how to connect to a database on a web server - 2009-06-04, 12:02

Join Date: Sep 2007
Posts: 502
Location: Bangalore
bhanuchandar.k's Avatar
bhanuchandar.k
Offline
Forum Nokia Champion
Hi elaltaico,
The driver usel will looklike this if you are using the mysql as your data base

URL: jdbc:mysql://sql104.byetcluster.com:3306/freew_355634_museum
jdbc:mysql://host:port/Database name

And also refer this thread to it will help you hoe to connect to the data base using midlet

http://discussion.forum.nokia.com/fo...d.php?t=162255


Regards
Bhanu Chandar K
http://newshunteterno.blogspot.com/
Reply With Quote

#3 Old Re: JDBC & how to connect to a database on a web server - 2009-06-04, 12:45

Join Date: May 2009
Posts: 108
elaltaico
Offline
Regular Contributor
Hello bhanuchandar


I got following error when I try to connect my database with the code that you gave me.. The error is :

Unable to add connection.Cannot establish a connection to

jdbc:mysql://sql104.free.ws:3306/freew_3556534_museum using com.mysql.jdbc.Driver (Communications link failure)

Lat packet sent to the servber was 0ms ago..


I checked everywhere even I checked my password and username if I mistyped them. But for now everything seems fine. I do not know why I come across with this error? Could you please help me to fix this error? Thank you in advance.


Best Regards
Altayli
Reply With Quote

#4 Old Re: JDBC & how to connect to a database on a web server - 2009-06-04, 15:02

Join Date: Sep 2007
Posts: 502
Location: Bangalore
bhanuchandar.k's Avatar
bhanuchandar.k
Offline
Forum Nokia Champion
Hi,
It means you are not able to connect to the host which you have specified or what ever port you are using it migh have blocked
see this link :
http://www.sqlpower.ca/forum/posts/list/1911.page


Regards
Bhanu Chandar K
http://newshunteterno.blogspot.com/
Reply With Quote

#5 Old Re: JDBC & how to connect to a database on a web server - 2009-06-04, 16:28

Join Date: May 2009
Posts: 108
elaltaico
Offline
Regular Contributor
Hello


After searching a lot (also by the helps of the bhanuchandar.k) I found two options to take infos from database. Could you please look at those two possible solutions and tell me which to choose? Thank you in advance.


First Option:


I will embeed database on server and I will preparare a PHP script where I will make the sql operations on PHP Script. Then I will assign the values which I defined at the PHP scrpit to the J2ME values.PHP script will be embeed on database.

Second Option:

I will use sql commands in a different class and take the information from that class to the MIdlet class.
Reply With Quote

#6 Old Re: JDBC & how to connect to a database on a web server - 2009-06-05, 06:29

Join Date: Sep 2007
Posts: 502
Location: Bangalore
bhanuchandar.k's Avatar
bhanuchandar.k
Offline
Forum Nokia Champion
Hi elaltaico,

Most of the people will prefer the first option what you have mentioned.


Regards
Bhanu Chandar K
http://newshunteterno.blogspot.com/
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobile Web Server Can't Connect ramadhian Mobile Web Server 1 2008-12-19 23:24
Unable to connect to my web application through GPRS Connection JasonSmithMiller General Symbian C++ 3 2008-11-19 22:16
Need help to connect to web server on Nokia 6630!!! SanjayKhuntia Mobile Java Networking & Messaging & Security 3 2008-09-01 06:16
browser can't able to contact web server. younker Symbian Networking & Messaging 0 2005-06-04 06:55
how to connect nokia toolkit 2.0 to a web server Nokia_Archived General Browsing 1 2002-05-15 17:12

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia