Build Salesforce to MySQL Integration Using Claude and MCP

by Jonathan Hikita | February 17, 2026

Build Salesforce to MySQL Integrations Using Claude Code and MCPThe promise of AI-assisted coding captivates developers worldwide. AI assistants write production-ready code from natural language prompts. But how well does it work for real-world, enterprise data integration projects?

This exercise puts that question to the test by building a Salesforce-to-MySQL integration application using AI-assisted development with CData drivers. We ran the build twice: once with traditional trial-and-error development and once using the CData Code Assist MCP to guide AI-generated code with live schema context. In this blog, we break down what worked, what didn’t, and how Claude and CData Code Assist MCP can streamline your next integration build.

The challenge

Build a Java application that integrates and syncs Salesforce objects (Accounts, Contacts, Products, and Orders) to existing MySQL tables, with specific business rules:

  • Only orders created on or after January 1, 2025

  • Only orders where Account Type = 'Direct'

  • Use JDBC drivers for production runtime

  • Work with an existing, undocumented MySQL schema

This represents a typical enterprise integration scenario built on JDBC-based data access. Developers usually spend hours debugging schema mismatches, foreign key relationships, and driver-specific behavior in projects like this.

The results at a glance

Metric

Without CData Code Assist MCP

With CData Code Assist MCP

Improvement

Development Time

~2.5 hours

~35 minutes

2+ hours saved

Compile-Run-Debug Cycles

13

1–2

85% reduction

First Run Accuracy

30%

90%

3x improvement

Schema Issues Found

During runtime

During coding

Proactive detection


The key difference? Visibility into CData schemas during development. With CData Code Assist MCP, AI coding tools explore CData schemas, tests queries, and validates assumptions before generating a single line of Java code. The result: accurate, production-ready code on the first compile.

Let's examine exactly how this plays out across six key schema-discovery moments that cost significant debugging time in the traditional approach.

The development prompt

“Create a Java application. I want Salesforce's Account, Contact, Product, and Order information to be copied to existing tables in MySQL. And only copy the Order created on or after Jan 1st, 2025. Please only select and copy the Orders with Account Type='Direct'. JDBC connection properties are saved in jdbc-connection.md.”

Prerequisites

  • JDK installed

  • Claude Code

  • CData JDBC Drivers for Salesforce and MySQL

  • Salesforce and MySQL credentials

  • CData Code Assist MCP for Salesforce and MySQL

Setting up CData Code Assist MCP with Claude Code

Step 1: Install CData Code Assist MCP

Go to the CData website and download the CData Code Assist MCP for Salesforce and MySQL. Complete the installation (Windows and Mac versions available).

Step 2: Configure connections to Salesforce and MySQL

After installation, open the cdata.mcp.salesforce.jar and cdata.mcp.mysql.jar files and configure the connections to Salesforce and MySQL. Set the connection properties in the UI and click the "Save & Test" button.

Connecting to Salesforce

Step 3: Generate MCP client configuration

Click "Next" to move to the MCP Client configuration. From the dropdown, choose "Claude Code". The UI generates a configuration JSON and guidance on where to store the JSON file. Create a .mcp.json file and store it under the project folder.

  "mcpServers" : {
  "CDataSalesforceSandbox" : {
   "type" : "stdio",
   "command" : "C:\\Program Files\\CData\\CData MCP Server for Salesforce
 2025\\jre\\bin\\java.exe",
   "args" : [ "-Dfile.encoding=UTF-8", "-jar", "C:/Program Files/CData/CData MCP Server for
 Salesforce 2025/lib/cdata.mcp.salesforce.jar", "CDataSalesforceSandbox" ],
  "env" : {}
 }
}

Close the CData Code Assist MCP UI. Repeat the same process for the destination MySQL side.

Step 4: Open Claude Code and configure the MCP Server

Open Claude Code and verify that it detects the MCP servers.

Adding Code Assist MCP to Claude Code

Step 5: Prompt Claude Code to generate the Java application

Once simple prompt reaches the AI Coding tool, it uses Code Assist MCP to inspect source and target schemas exposed by CData drivers.

Prompting Claude Code to create the Java app

With validated schema context, the AI generates a Java application that maps Salesforce and MySQL using the same CData schemas and SQL semantics used at runtime.

Claude Code creating the Java app

Sample Java app output

The development prompt

Without CData Code Assist MCP, Claude Code hits six different schema issues:

  • Wrong primary key mapping (Id vs SalesforceId)

  • Missing columns/fields (BillingStreet, MobilePhone)

  • Table/object name mismatches (Product2 vs products)

  • Non-existent tables/objects (order)

  • Driver syntax incompatibilities (VALUES() function)

  • Foreign key confusion (AccountId vs SalesforceAccountId)

Let’s explore each of these discoveries in the following sections.

Part 1: Schema discovery in action

Discovery 1: Account table field mapping

Without CData Code Assist MCP:

  • Assumes Salesforce Id maps to MySQL Id

  • Assumes billing address fields exist in MySQL

  • Fails at runtime with "Unknown column 'BillingStreet'"

  • Requires writing InspectMySQLSchema.java utility to discover the actual schema

With CData Code Assist MCP:

Claude Code calls CDataSalesforceSandbox_get_columns(table="Account") and discovers:

  • Primary Key: Id (VARCHAR)

  • Available fields: BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry

  • Available fields: Name, Type, Industry, Phone, Website

  • Available fields: CreatedDate, LastModifiedDate

  • Total: 190+ columns including custom fields

Claude Code then calls CDataMySQL_get_columns(catalog="internalcrm", table="account") and discovers:

  • Primary Key: Id (INT, AUTO_INCREMENT) — Different from Salesforce

  • SalesforceId (VARCHAR) — This is where Salesforce.Id should map

  • Available fields: Name, Type, Industry, Phone, Website

  • NO billing address fields

Important findings:

  • MySQL Id is INT auto-increment, not the Salesforce ID

  • MySQL SalesforceId is where Salesforce Id should map

  • MySQL has no billing address columns

  • Field names match: Name, Type, Industry, Phone, Website

Generated code with CData Code Assist MCP:

// Claude Code generates this CORRECT mapping from the start:
String upsert = "INSERT INTO account (SalesforceId, Name, Type, Industry, " +
        "Phone, Website, CreatedDate, LastModifiedDate) " +
        "VALUES (?, ?, ?, ?, ?, ?, ?, ?) " +
        "ON DUPLICATE KEY UPDATE Name = ?, Type = ?, ...";
// Map Salesforce.Id → MySQL.SalesforceId (not Id!)
pstmt.setString(1, account.getId()); // to SalesforceId column
pstmt.setString(2, account.getName());
// NO billing fields included

Discovery 2: Contact table field mapping

Without CData Code Assist MCP:

  • Assumes standard field mappings

  • Runtime error reveals MobilePhone doesn't exist in MySQL

  • Requires rewriting ContactSyncService.java

With CData Code Assist MCP:

Claude Code calls CDataSalesforceSandbox_get_columns(table="Contact") and discovers:

  • Id, AccountId, FirstName, LastName, Email, Phone

  • MobilePhone, Title, Department

  • CreatedDate, LastModifiedDate

Claude Code then calls CDataMySQL_get_columns(catalog="internalcrm", table="contact") and discovers:

  • Id (INT), SalesforceId (VARCHAR), AccountId (INT) — Foreign Key to account.Id

  • SalesforceAccountId (VARCHAR) — For Salesforce Account reference

  • FirstName, LastName, Email, Phone, Title, Department

  • NO MobilePhone field

Important findings:

  • MySQL has TWO Account references:

    • AccountId (INT) links to MySQL account.Id

    • SalesforceAccountId (VARCHAR) stores Salesforce Account ID

  • MySQL has no MobilePhone field

  • Same pattern as Account: SalesforceId for Salesforce Contact ID

Discovery 3: Product table schema mismatch

Without CData Code Assist MCP:

  • Creates ProductSyncService.java for the "Product" table

  • Fails at runtime: table structure is completely different

  • User manually disables Product sync

With CData Code Assist MCP:

Claude Code calls CDataSalesforceSandbox_get_columns(table="Product2") and discovers:

  • Table name is "Product2" (not "Product")

  • Id, Name, ProductCode, Description

  • IsActive, Family, CreatedDate, LastModifiedDate

Claude Code then calls CDataMySQL_get_columns(catalog="internalcrm", table="products") and discovers:

  • product_id (INT, PRIMARY KEY)

  • product_code, product_name, description

  • category, unit_price, cost_price, list_price

  • is_active, created_date, modified_date

  • salesforce_key (VARCHAR) — For Salesforce Product ID

Important findings:

  • Salesforce table: Product2, MySQL table: products

  • Completely different schema structure:

    • Salesforce: Id → MySQL: product_id (INT)

    • Salesforce: ProductCode → MySQL: product_code

    • Salesforce: Name → MySQL: product_name

    • MySQL has pricing fields, not in Salesforce

    • MySQL has salesforce_key for mapping

  • This requires custom mapping logic, not simple field copy

Discovery 4: Order table does not exist

Without CData Code Assist MCP:

  • Creates OrderSyncService.java with complex filtering logic

  • Fails at runtime: "Table 'order' doesn't exist"

With CData Code Assist MCP:

Claude Code calls CDataSalesforceSandbox_get_columns(table="Order") and discovers:

  • Id, AccountId, OrderNumber, Status, TotalAmount

  • EffectiveDate, Description, CreatedDate

  • Has all required fields for sync

Claude Code then calls CDataMySQL_get_tables(catalog="internalcrm", table="%order%") and discovers:

  • No table named "order" or "orders"

  • Found: account, contact, products, invoices, opportunities

  • The Order table does not exist in MySQL

Important Finding: Order table does not exist in the MySQL database

Part 2: Query testing before coding

Discovery 5: Complex Order query with JOIN

Without CData Code Assist MCP, the coding assistant:

  • Writes the INNER JOIN query blindly

  • Waits for compile → run → check logs to verify it works

  • Does not know if the query syntax is correct until runtime

With CData Code Assist MCP:

Using CData Code Assist MCP, the AI tests the date filter by callingCDataSalesforceSandbox_run_query with a COUNT query:

SELECT COUNT(*) AS TotalOrders
FROM [Order]
WHERE CreatedDate >= '2025-01-01 00:00:00'

Result: 4,359 orders match date filter.

Claude Code then tests the full JOIN query:

SELECT TOP 5 o.Id, o.AccountId, o.OrderNumber, o.Status,
   o.TotalAmount, o.CreatedDate,
   a.Name AS AccountName, a.Type AS AccountType
FROM [Order] o
INNER JOIN Account a ON o.AccountId = a.Id
WHERE o.CreatedDate >= '2025-01-01 00:00:00'
AND a.Type = 'Direct'
ORDER BY o.CreatedDate DESC

The query returns valid results:

Id

Account Name

Type

Total Amount

Created Date

801TV00000WLZhxYAH

Hartwell Distribution Co.

Direct

499.00

2025-09-09 10:59

801TV00000WHLteYAH

Meridian Beverage Group

Direct

1996.00

2025-09-08 11:42

801TV00000WFu5wYAD

Stonefield Holdings Ltd

Direct

499.00

2025-09-08 04:43

801TV00000WFbedYAD

Vantara Systems GmbH

Direct

2746.00

2025-09-08 03:44

801TV00000W9TQKYA3

Cascade Regional Authority

Direct

999.00

2025-09-05 19:02


This confirms that the query is valid against the live CData schema, and it returns the expected data.

Generated code works the first time:

String query = "SELECT o.Id, o.AccountId, o.OrderNumber, o.Status, o.TotalAmount, " +
  "o.CreatedDate, o.LastModifiedDate " +
  "FROM [Order] o " +
  "INNER JOIN Account a ON o.AccountId = a.Id " +
  "WHERE o.CreatedDate >= '2025-01-01 00:00:00' " +
  "AND a.Type = 'Direct'";
// Tested and verified BEFORE embedding in Java code!

Part 3: Development time comparison

This section compares two real timelines, one without CData Code Assist MCP and one with CData Code Assist MCP, to highlight just how much time, effort, and frustration you can save by integrating schema-aware tooling from the start.

Timeline without CData Code Assist MCP

Time (hh:mm)

Activity

0:00

User requests sync application

0:15

The AI generates 12 Java classes based on assumptions

0:25

Compile successful

0:30

Run #1: VALUES() function error

0:45

Fix UPSERT syntax in 4 service classes, recompile

0:50

Run #2: Batch execution error

1:00

Disable batching in 4 service classes, recompile

1:05

Run #3: Unknown column 'BillingStreet'

1:15

Write InspectMySQLSchema.java utility

1:20

Run inspector, discover actual schema

1:35

Rewrite 4 service classes with the correct schema

1:40

Run #4: Too many connections

1:50

Add batched commits, recompile

1:55

Run #5: Transaction timeout

2:05

Enable auto-commit mode, recompile

2:10

Run #6: Still timeout issues

2:20

Add connection throttling delays

2:25

Run #7: Partial success (100 records only)


  • Total Time: ~2.5 hours

  • Iterations: 13 compile-run-debug cycles

  • Success Rate: Partial (limited by driver)

Timeline with CData Code Assist MCP

Time (hh:mm)

Activity

0:00

User requests sync application

0:01

Check the Salesforce Account schema via MCP

0:02

Check MySQL account schema via MCP

0:03

Discover field mapping differences (IdSalesforceId)

0:04

Check Contact schemas via MCP

0:05

Test Order JOIN query via MCP

0:06

Check Product schemas via MCP

0:07

Discover Product schema mismatch

0:08

Check if the MySQL order table exists via MCP

0:09

Test UPSERT syntax via MCP

0:10

Discover VALUES() incompatibility

0:11-0:25

Generate Java code with all corrections

0:30

Compile successful

0:32

Run #1: Works correctly!

0:35

Handle CData driver performance considerations


  • Total Time: ~35 minutes

  • Iterations: 1-2 compile-run cycles

  • Success rate: High (90% first-run success)

  • Time saved: ~2 hours

What MCP enables for development

Developers often waste time guessing schema structures, debugging driver quirks, or rewriting broken queries. With CData Code Assist MCP, you get the visibility and tooling to avoid all of that upfront. From exploring live schemas to validating SQL and generating ready-to-run code, here’s what MCP unlocks at every stage of integration development:

A. Interactive Schema Exploration

  • See exact table structures before writing code

  • Understand field types, constraints, and foreign keys

  • Discover schema mismatches instantly

B. Query Validation

  • Test complex SQL queries before embedding in code

  • Verify JOIN syntax works with actual data

  • Confirm filters return expected results

C. Driver Compatibility Testing

  • Test JDBC connection strings

  • Discover JDBC driver quirks (VALUES(), batching)

  • Identify syntax limitations early

  • Validate UPSERT patterns work

D. Data Sampling

  • See actual data structure and values

  • Understand data types and formats

  • Verify assumptions about data

E. Informed Code Generation

  • Generate code with correct mappings from the start

  • Include only fields that exist in the target

  • Use compatible SQL syntax

  • Handle edge cases proactively

Key takeaways

CData Code Assist MCP fundamentally changes how AI-assisted integration development happens.

In a traditional workflow, development often follows a repetitive loop: write code, compile, run it, hit errors, debug, and repeat. With CData Code Assist MCP, the workflow becomes far more intentional and informed. Developers can first explore schemas, test queries, validate assumptions, and then generate code with confidence.

The real advantage is development-time visibility into the same schemas and behaviors enforced by CData drivers at runtime. Claude Code can interact with both source and target data systems before any Java code is written. That early insight leads to correct field mappings, compatible SQL syntax, and validated queries from the start. As a result, teams experience fewer debugging cycles, more reliable first runs, and a much faster path to working code.

Importantly, the final application remains a standard Java application built on CData JDBC implementation. There are no MCP dependencies or LLM calls at runtime. CData Code Assist MCP is used only during development to guide smarter code generation.

Accelerate AI-assisted development with CData Code Assist MCP and CData Drivers

CData Code Assist MCP connects AI coding tools to 350+ enterprise data sources, enabling schema exploration and live data access through the Model Context Protocol (MCP). Download your free CData Code Assist MCP for Salesforce to see for yourself!

Explore CData Drivers and Connectors

Get blazing-fast access to live data with seamless connectivity from your data sources to the tools you use every day. Our standards-based connectors make data integration effortless – just point, click, and go.

Try them now