Ispirer Toolkit automatically converts Sybase to Java, considering its specifics
Both conversion with connection to the source database, as well as conversion of files containing SQL scripts are possible.
Make the most of automated migration to focus on your business core
Get started. Check migration plansIspirer Ecosystem automates your migration routine to enable quick and smart transformation of any database. Double the migration speed with our comprehensive solutions.
Trial is free. No payment
Trial is free. No payment
Ispirer has a solution to unlock the full potential of your database. Our team helps you to move business logic to an application layer seamlessly to advance the database performance.
Our automated migration engine analyzes the original ASE T-SQL code at the Abstract Syntax Tree (AST) level and accurately transforms:
Both conversion with connection to the source database, as well as conversion of files containing SQL scripts are possible.
Every database object (stored procedures, functions, etc.) is automatically transformed into a Java class. Names of the classes are formed based on object names, taking into account the Java Naming Convention.
At the same time, tables, views, triggers remain on the database side.
In this case, you need a Java application to work with a different database, Ispirer Toolkit can convert Embedded SQL and the database itself.
The tool automatically converts function and procedure variables to method variables.
Sybase system functions and procedures are converted either to the same Java methods, if any, or to the methods of helper class.
This flexibility ensures that the generated code can be seamlessly integrated into different technology stacks while preserving familiar tools for working with the database.
Dive into tool’s features
More than 2K users use this way to
successfully convert their database
Ispirer Toolkit analyzes all object dependencies during the conversion process and provides not only line-by-line conversion, but resolves type conversions as well. The software understands and transforms the necessary inheritance dependencies. It parses the entire source code, builds an internal tree with all the information about the objects, and uses it in the migration process.
We convert Sybase ASE stored procedures to Java with attention to all the specifics
Sybase T-SQL
create procedure sp_demo_orders @CustomerId int, @TotalAmount numeric(12,2) output as begin declare @OrderId int declare @OrderAmount numeric(10,2) declare @CurrentDate datetime declare @Count int declare @SumAmount numeric(12,2) select @CurrentDate = getdate() select @TotalAmount = 0 select @SumAmount = 0 select @Count = 0 print "Order processing started at " + convert(varchar(30), @CurrentDate) if @CustomerId is null or @CustomerId <= 0 begin raiserror 50010 "Invalid Customer Id" return end -- Cursor for orders of this customer declare order_cursor cursor for select OrderId, Amount from Orders where CustomerId = @CustomerId open order_cursor fetch order_cursor into @OrderId, @OrderAmount while @@FETCH_STATUS = 0 begin select @Count = @Count + 1 select @SumAmount = @SumAmount + isnull(@OrderAmount, 0) -- Apply discount logic if @OrderAmount > 1000 begin print "Large order " + convert(varchar, @OrderId) + ": applying discount" select @OrderAmount = @OrderAmount * 0.9 end -- Simulate error on negative amount if @OrderAmount < 0 begin raiserror 50011 "Negative order amount detected" close order_cursor deallocate cursor order_cursor return end select @TotalAmount = @TotalAmount + @OrderAmount fetch order_cursor into @OrderId, @OrderAmount end close order_cursor deallocate cursor order_cursor print "Customer " + convert(varchar, @CustomerId) + " has " + convert(varchar, @Count) + " orders" print "Total before discounts: " + convert(varchar, @SumAmount) print "Final total amount: " + convert(varchar, @TotalAmount) print "Average order: " + convert(varchar, @TotalAmount / nullif(@Count,0)) print "Order processing finished at " + convert(varchar(30), getdate()) end
→ Java
import com.sql4j.db.cursor.*; import com.sql4j.exception.ErrorUtil; import com.sql4j.transaction.aop.TransactionStatus; import com.sql4j.util.*; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.context.annotation.RequestScope; @Service @RequestScope public class SpDemoOrders implements ISpDemoOrders { @Autowired private ErrorUtil errorUtil; @Autowired private CursorStatusService cursorStatusService; @TransactionStatus @Override public Map< String, Object > spSpDemoOrders(Integer customerid, BigDecimal totalamount) { Map<String, Object> outData = new HashMap<>(); outData.put("retStatus", 0); try { Integer orderid = null; BigDecimal orderamount = null; LocalDateTime currentdate = null; Integer count = null; BigDecimal sumamount = null; currentdate = TimeUtil.getDate(); totalamount = new BigDecimal("0"); sumamount = new BigDecimal("0"); count = 0; System.out.println(StringUtil.concat("Order processing started at ", Converter.toString(currentdate))); if (customerid == null || ComparisonUtil.isLessOrEqual(customerid, 0)) { errorUtil.raisError(50010, "Invalid Customer Id"); return outData; } CursorReader orderCursor = new CursorReader(cursorStatusService, true, "select OrderId, Amount " + "from Orders " + "where CustomerId = :CUSTOMERID ", "CUSTOMERID", customerid); orderCursor.open(); if (orderCursor.fetchNext()) { orderid = orderCursor.getColumnValue(Integer.class); orderamount = orderCursor.getColumnValue(BigDecimal.class); } while (ComparisonUtil.areEqual(cursorStatusService.getFetchStatus(), 0)) { count = Converter.toInteger(MathUtil.add(count, 1)); sumamount = MathUtil.add(sumamount, ComparisonUtil.isNull(orderamount, new BigDecimal("0"))); // Apply discount logic if (ComparisonUtil.isGreaterThan(orderamount, 1000)) { System.out.println(StringUtil.concat("Large order ", Converter.toString(orderid), ": applying discount")); orderamount = MathUtil.multiply(orderamount, new BigDecimal("0.9")); } // Simulate error on negative amount if (ComparisonUtil.isLessThan(orderamount, 0)) { errorUtil.raisError(50011, "Negative order amount detected"); orderCursor.close(); orderCursor.deallocate(); return outData; } totalamount = MathUtil.add(totalamount, orderamount); if (orderCursor.fetchNext()) { orderid = orderCursor.getColumnValue(Integer.class); orderamount = orderCursor.getColumnValue(BigDecimal.class); } } orderCursor.close(); orderCursor.deallocate(); System.out.println(StringUtil.concat("Customer ", Converter.toString(customerid), " has ", Converter.toString(count), " orders")); System.out.println(StringUtil.concat("Total before discounts: ", Converter.toString(sumamount))); System.out.println(StringUtil.concat("Final total amount: ", Converter.toString(totalamount))); System.out.println(StringUtil.concat("Average order: ", Converter.toString(MathUtil.divide(totalamount, ComparisonUtil.nullIf(count, 0))))); System.out.println(StringUtil.concat("Order processing finished at ", Converter.toString(TimeUtil.getDate()))); return outData; } finally { outData.put("totalamount", totalamount); } } }
Fact 1/6
Applications can offer more flexibility and agility in managing and modifying business logic than databases. It's easier and faster to update and iterate on application code rather than altering database architecture, structure, stored procedures and data.
Fact 2/6
Business logic embedded within applications is more portable across different database systems or platforms. It can be beneficial if the business needs to switch database vendors or deploy the application in various environments.
Fact 3/6
Application servers are much easier to scale than database servers. Depending on the load users create, an application can be placed in a container and used as needed. It will be much easier and cheaper to achieve the system's desired performance using Ispirer solutions.
Fact 4/6
Having business logic in the application layer unties your hands if you plan to change a database management system. This approach allows the simultaneous support of several databases.
Fact 5/6
Migrating to Java can enable the adoption of new technologies and features, unlocking new business opportunities and driving innovation.
Fact 6/6
We perform the migration using the source code. There is no need for detailed documentation to begin the migration as there is in development.
Mixon, Magnit, CardinalHealth, and more have adopted SQLWays to boost their innovation life-cycle accelerate and manage their end-to-end innovation lifecycle
Take control of your database
migration now
It only takes 5 minutes!