The conversion from UNKNOWN to UNKNOWN is unsupported

I get the following exception running a stored procedure: The conversion from UNKNOWN to UNKNOWN is unsupported.

  • Using “UNION” with “IF EXISTS”
  • how can i see data in mdf file
  • Queries for Sql Server and Oracle
  • SQL Server DataType of TEXT does not maintain formatting
  • Why can't I use alias in a count(*) “column” and reference it in a having clause?
  • What is {ts '2013-04-02 00:00:00'}?
  • The procedure is defined like this:

    @p1 varchar(1024) ,
    @p2 varchar(1024) ,
    @p3 char(1) ,
    @p4 varchar(254),
    @p5 varchar(254),
    @debug bit )

    My parameters in Java are defined like this:

    Object[] params = {“1,2,3”, “d”, ‘2’, “”, “”, 1};

    I think it’s caused by the character. Any ideas why?

  • how to save image path to sql database in java
  • JDBC connection failed, error: TCP/IP connection to host failed
  • Native Library sqljdbc_auth.dll already loaded in another classloader
  • Find SQL Servers using Java
  • jdbc:jtds Connection to SQL server
  • Can a Java application running on a Window's Server connect to SQL Server via Windows Authentication
  • One Solution collect form web for “The conversion from UNKNOWN to UNKNOWN is unsupported”

    I found it. Clockwork-Muse put me on the path. The char type does not convert to an Object when you set the parameters. The following will work:

         try (PreparedStatement st = con.prepareStatement(query)) {
            int n = 1;
            for (Object o : params) {
                if (o instanceof Character) {
                    o = "" + o;
                st.setObject(n, o);
    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.