BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-26-2008, 02:26 AM   #1 (permalink)
New Member
 
Join Date: Aug 2008
Model: 8100
PIN: N/A
Carrier: java developer
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question How to retrieve email address from BES

Please Login to Remove!

Hi Friends,

I want to start a blackberry application to fetch the email addresses from BES. On BES there is mapping of PIN to Email. So can we write any method to retrieve email address mapped on BES by sending some PIN or IMEI number as a parameter on my blackberry application? If anyone knows, please help me.


Thanks in advance

Last edited by dhanashree.rao : 08-27-2008 at 01:51 AM.
Offline  
Old 08-26-2008, 02:54 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: IT
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I hope I got your point.

So, you want to get the mail address by sending the PIN of any blackberry?

The only way I know is to check the PIN in the BES database (the "userconfig" in DB "BESmgt").

But maybe there is a better way.

Happe
Offline  
Old 08-26-2008, 03:30 AM   #3 (permalink)
New Member
 
Join Date: Aug 2008
Model: 8100
PIN: N/A
Carrier: java developer
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Happe for ur valuable suggession.
But how can I check in the BES database programatically?
Offline  
Old 08-26-2008, 04:21 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: IT
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

In this case you have to develop a Client-Server-Application.

Then you send the PIN from the BB to the server and then the server checks the PIN in the databse (of course you need a sql server authentification to the BES Database).

I know it is tricky but I think there is no way to connect directly from the BB to the BES database.

Happe

Last edited by Happe79 : 08-26-2008 at 04:23 AM.
Offline  
Old 08-26-2008, 04:53 AM   #5 (permalink)
New Member
 
Join Date: Aug 2008
Model: 8100
PIN: N/A
Carrier: java developer
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx Happe.
Do you have any idea to access the server side BES database (directly/indirectly) through any api?

Thanks,
Dhanashree
Offline  
Old 08-26-2008, 05:32 AM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: IT
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Depends on the programming language you use for the server ;).


If you use Java then you could use Connection Object.

Code:
import java.sql.Connection;
import java.sql.Statement;

Class.forName("com.mssql.jdbc.Driver");
		
String url = "jdbc:mssql://localhost:port/database";
		
Connection con = DriverManager.getConnection( url, username, password);
Statement stmt = con.createStatement();

stmt.execute("SQL Query");
stmt.close();
If you use C# then System.Data.SqlClient.SqlConnection Object is very useful.

Code:
SqlConnection conn = new SqlConnection(CONNSTRING);

SqlCommand cmd = new SqlCommand("SQL Query", conn);
SqlDataReader rdr = cmd.ExecuteReader();

while (rdr.Read())
 {
         String  exchange_server = rdr[0].ToString();
         .
         .
         .
 }
 rdr.Close();

Hope this helps.


Happe
Offline  
Old 08-26-2008, 08:58 AM   #7 (permalink)
New Member
 
Join Date: Aug 2008
Model: 8100
PIN: N/A
Carrier: java developer
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

For a normal database connectivity, we use the above programming technique. Pleses let me know is there any different technique to connect to the BES database. and if the same logic we have to use then what will be the connection string to connect to the BES database?
Offline  
Old 08-26-2008, 09:24 AM   #8 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: IT
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You mean, you use the java technique?

There shouldn't be a difference. It is a usual MS SQl connection.

The connection string is e.g. "jdbc:mssql://[BESServer]:[BESPort]/BESMgmt"

and the query could be "SELECT MailBoxSMTPAddr FROM UserConfig WHERE PIN LIKE 2100000a"


Maybe take a look in the table UserConfig of BES database before!

Happe
Offline  
Old 08-26-2008, 09:33 AM   #9 (permalink)
New Member
 
Join Date: Aug 2008
Model: 8100
PIN: N/A
Carrier: java developer
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Happe,
i will definatly try it.
Offline  
Old 09-12-2008, 11:30 AM   #10 (permalink)
CrackBerry Addict
 
qc_metal's Avatar
 
Join Date: Mar 2005
Location: Rockford, IL
Model: 9530
OS: 4.7.x
Carrier: Verizon
Posts: 590
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by dhanashree.rao View Post
Hi Friends,

I want to start a blackberry application to fetch the email addresses from BES. On BES there is mapping of PIN to Email. So can we write any method to retrieve email address mapped on BES by sending some PIN or IMEI number as a parameter on my blackberry application? If anyone knows, please help me.


Thanks in advance
See my signature - if for nothing else, there are a ton of SQL queries in the reporting section of BerryStats that may help you with some of the verbage if going the ADO route.
__________________
Provision, maintain, and report on users via web: the NEW BerryStats | FAQ
Offline  
Closed Thread


Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.