Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: How to change target database: [Kettle Java API]

  1. #1

    Default How to change target database: [Kettle Java API]

    I am using the following xml string to generate transformation:

    databaseXML = {
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
    "<connection>" +
    "<name>MSSQLDB</name>" +
    "<server>*****************</server>" +
    "<type>MSSQL</type>" +
    "<access>Native</access>" +
    "<database>msdb</database>" +
    "<port>1433</port>" +
    "<username>*********</username>" +
    "<password>********</password>" +
    "</connection>",

    but even though I change the database name, it is creating the target tables in The default database "master". How can I change that?

  2. #2
    Join Date
    Sep 2013
    Posts
    235

    Default

    Your transformation steps can use different connection defined. Even if you have
    Code:
    <name>MSSQLDB</name>
    this is the name for steps do determine database connection to use,
    Code:
    <database>msdb</database>
    this is the name of database on remote server.
    You may have master database defined as shared resource in kettle home directory - and since steps has a name of shared master connection - they do use master connection. Not a connection from xml with name MSSQLDB.
    If you attach a sample transformation xml or give more details we can see more.

  3. #3

    Default

    Now I tried connecting without the xml string as follows:

    DatabaseMeta targetDBInfo = new DatabaseMeta("target","MSSQL","Native","serveraddress","dbname","1433","user","pwd");

    But still tables are created in the default MSSQL database, which is master.
    All the other parameters are working but why not the dbname???!!!

    Does KettleEnvironment.init(); sets some default value for the database? How do I know that. I am not generating any xml from the transformation. I am directly executing the transformation from transMeta object using the java API.

  4. #4
    Join Date
    Sep 2013
    Posts
    235

    Default

    Can you specify example of target jdbc url you want to use to connect to your MSSQL database?

  5. #5

    Default

    "jdbc:jtds:sqlserver://abc.efg.com:1433/msdb;instance=myinstance;user=xxx;password=xxx";

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.