Hii all,
Can anyone help me how insert stringlist from IS to oracle table with jdbc.
Rg,
-Widodo-
Hii all,
Can anyone help me how insert stringlist from IS to oracle table with jdbc.
Rg,
-Widodo-
Widodo,
Assuming you want each string to be stored in a separate database record, you could do this:
HTH,
Michael
Hi Widodo,
You could also try that:
create a java-flow with input variable “strlist” as string list.
Then add (not tested) source code below. It’s not a nice
peace of code, but it might give you an idea.
You’ve of course to check for the right JDBC driver and place
it in the lib/jars folder of the IS or your package.
Good luck
private static JDBCConnection dbConnection = null;
IDataCursor cursor = pipeline.getCursor();
cursor.first("strlist");
String list[] = (String[])Cursor.getValue();
try
{
dbConnection = new JDBCConnection ("db", "user", "passwd", "driver");
} catch (DBConnectionException e)
{
// do something
}
try
{
query = "INSERT INTO TABLE"
+"(FIELD1,"
+" FIELD2)"
+ "VALUES ('"+list[0]+"','"
+list[1]+"'"')";
Values result = dbConnection.execSQL (query);
dbConnection.commit();
} catch (DBConnectionException e)
{
// do something
}
Hi all,
Thx for your solution i will try.
Best Regard,
-Widodo