Results 1 to 10 of 10

Thread: Accessing SugarCRM using Java

  1. #1
    SherlonV is offline Member
    Join Date
    Jul 2010
    Posts
    7

    Default Accessing SugarCRM using Java

    Hi im new to the forums and not totally experienced using SugarCRM Community Edition
    I've already searched for related threads about java but I haven't seen a direct thread about it.

    What I use:
    http://www.sugarcrm.com/crm/download/sugar-suite.html
    FastStack Windows Installer for 6.0.0R with SQL Server

    I'm trying to use the data from SugarCRMs database and apply it onto a Java program.
    I have tried looking into my ODBC connections but when I try to add a new connection
    I don't see anything from the SugarCRM side.

    My question is Is there a way to get the data from SugarCRM and use the data in a Java application?

    Thanks to those who would reply

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Accessing SugarCRM using Java

    You can use SOAP to retrieve the data. Check out the developers web site for more info: http://developer.sugarcrm.com

    If you want to extract data directly from the database via ODBC, you should be able to do it by setting up an ODBC datasource for MS-SQL
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    SherlonV is offline Member
    Join Date
    Jul 2010
    Posts
    7

    Default Re: Accessing SugarCRM using Java

    Hi firstly thanks for the reply.

    I tried doing what you said about the ODBC connection. Though my problem is that
    im not too clearly sure if i have the appropriate data sources. When you said MS-SQL
    I went looking for a Microsoft SQL. Thing is nothing close came to it. Im wondering if
    you are referring to a data source built in to Windows by default like MS Access or
    something I need to get.

    Thanks in advance for any replies

  4. #4
    SherlonV is offline Member
    Join Date
    Jul 2010
    Posts
    7

    Default Re: Accessing SugarCRM using Java

    Just to clarify what I meant with my last post


    Those are all the data sources i have starting from microsoft

    i was wondering if you meant the MS SQL from this site;
    http://www.microsoft.com/sqlserver/2...Downloads.aspx

  5. #5
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Accessing SugarCRM using Java

    "SQL Server" would allow you to connect to your Sugar database.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  6. #6
    SherlonV is offline Member
    Join Date
    Jul 2010
    Posts
    7

    Default Re: Accessing SugarCRM using Java

    alright thanks ill give it a try

  7. #7
    SherlonV is offline Member
    Join Date
    Jul 2010
    Posts
    7

    Default Re: Accessing SugarCRM using Java

    Ok its my mistake that ive said i have been using fast stack with SQL Server but apparentylu
    im using the one with MYSQL. I suppose that the steps ive been taking are wrong due to my stupidness.

    Like SQL Server is there a way to connect via MY SQL? Or should I use the SQL Server pack?

  8. #8
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Accessing SugarCRM using Java

    Yes, there is a way, but you likely need to install the MySQL ODBC drivers first.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  9. #9
    SherlonV is offline Member
    Join Date
    Jul 2010
    Posts
    7

    Default Re: Accessing SugarCRM using Java

    It looks like i can connect via the obdc now but im having a hard time figuring out how to connect
    to a specific schema/database. This cause I have several databases;
    i.e.

    information_schema (17)
    mysql (17)
    sugarcrm (99)
    test (0)

    my usual way of connecting via java is so

    Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package connectsugar;
    
    import java.sql.ResultSet;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    
    import javax.swing.*;
    import javax.swing.event.*;
    import java.sql.*;
    
    /**
     *
     * @author Chase
     */
    public class Main {
    
        private	static Connection  conn;
        private     String      SQLStatement;
        private	String      url;
        private	static Statement   stmt;
        private	ResultSet   rset;
        int cid=0;
    
    
        public void test(){
                try {
                ResultSet rs;
                String url = "jdbc:odbc:db";						       
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 			
                conn = DriverManager.getConnection(url, "root@localhost", "1234");
                stmt = (Statement) conn.createStatement();
                SQLStatement = "SELECT MAX(Branchno) as 'max' FROM branch";
                rs = stmt.executeQuery(SQLStatement);
                rs.next();					
                cid = rs.getInt("max");
                cid++;
    
                stmt.close();
                conn.close();
    
            } catch (Exception ex) {
                System.out.println(ex.getMessage());
            }
            }
    
        public static void main(String[] args) {       
    
        }
    }
    I was wondering how to connect to specific db's using this format. If i can't can anyone suggest how to connect using java?

  10. #10
    SherlonV is offline Member
    Join Date
    Jul 2010
    Posts
    7

    Default Re: Accessing SugarCRM using Java

    Finally got it done through trial and error :|
    Anyways thanks for your help with my issue
    Closing thread

    Um this sounds illy but i cant find the button for which to close this thread lol
    Last edited by SherlonV; 2010-07-23 at 05:31 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Java SugarCRM
    By machineghost in forum General Discussion
    Replies: 4
    Last Post: 2012-05-21, 04:42 AM
  2. Accessing SugarCRM Externally
    By charitha in forum Help
    Replies: 3
    Last Post: 2009-08-13, 02:49 PM
  3. Problem while accessing sugarcrm
    By deveshm in forum General Discussion
    Replies: 5
    Last Post: 2009-07-20, 12:02 PM
  4. Replies: 0
    Last Post: 2009-06-06, 03:40 PM
  5. Java/SugarCRM intergation
    By bathi741 in forum Developer Help
    Replies: 6
    Last Post: 2009-03-17, 10:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •