-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A new type handler for SQLXML data type. #1221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @harawata,
I've added some comments.
} | ||
|
||
protected String sqlxmlToString(SQLXML sqlxml) throws SQLException { | ||
String result = sqlxml.getString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs the null check.
import java.sql.SQLException; | ||
import java.sql.SQLXML; | ||
|
||
public class SqlxmlTypeHandler extends BaseTypeHandler<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add JavaDoc(description, since, author...).
SQLXML sqlxml = ps.getConnection().createSQLXML(); | ||
sqlxml.setString(parameter); | ||
ps.setSQLXML(i, sqlxml); | ||
sqlxml.free(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need to call free()
, it may be better to call it in try-finally.
Thanks @kazuki43zoo ! |
/** | ||
* Convert <code>String</code> to/from <code>SQLXML</code>. | ||
* | ||
* @since 3.4.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.5.0 or 3.4.7 ?
Thank you for the update, @kazuki43zoo ! |
Requires drivers support JDBC 4.0+.
Requires drivers support JDBC 4.0+.
It seems to be working with...
XMLTYPE
column)XML
column)XML
column / mssql-jdbc driver)XML
column / db2jcc4 driver)