Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#434 Import databases connections from DBvis to Squirrel

open
nobody
Unknown (17)
5
2011-09-07
2011-09-07
Fernandezc
No

Hello,

I'm looking for a solution to import a lot of databases connections set in Dbvisualizer directly in Squirrel SQL. I know that a .XML file exists in Dbvis, with all those informations (we are sharing it to quickly configure a new Dbvis instalation) in it.
In Squirrel it's stored in SQLAliases23.xml and SQLDrivers.xml . After a mail with Rob, He suggest me to ask here.

here is an exemple of the DBvis XML file :

<Database id="4">
<Alias>X.X.X.X - Alias' name</Alias>
<Url>jdbc:oracle:thin:@X.X.X.X:1521:KSDB</Url>
<Driver>Oracle Thin</Driver>
<Userid>pcms_data_manager</Userid>
<Profile>auto</Profile>
<Type>oracle</Type>
<Password>cOVHmixLsCU=</Password>
<Properties />
</Database>

I hope it will be possible to import my databases connections easyly.

BR C.Fernandez

Discussion

  • Rob Manning
    Rob Manning
    2011-09-07

    Additionally, the driver information can also be found in dbvis.xml. For example:

    <Driver>
    <Name>JavaDB/Derby embedded</Name>
    <IsDefaultDriver>true</IsDefaultDriver>
    <URLFormat>jdbc:derby:&lt;databaseName&gt;</URLFormat>
    <DefaultClass>org.apache.derby.jdbc.EmbeddedDriver</DefaultClass>
    <Locations>
    <Location type="dynamic">
    <Path>C:\tools\DbVisualizer-8.0.3\jdbc\derby\derby.jar</Path>
    <Classes>
    <Class type="jdbc">org.apache.derby.jdbc.EmbeddedDriver</Class>
    </Classes>
    </Location>
    <Location type="dynamic">
    <Path>C:\tools\DbVisualizer-8.0.3\jdbc\derby\derbyclient.jar</Path>
    </Location>
    <Location type="dynamic">
    <Path>C:\tools\DbVisualizer-8.0.3\jdbc\derby\derbynet.jar</Path>
    </Location>
    </Locations>
    </Driver>

    So, for completeness, we probably would want to ask the user for a location to store driver files and import driver definitions into SQLDrivers.xml after copying them to a separate user-specified location (in case the user doesn't want to keep DBVis installed). This won't be trivial as we'll need to "find" the correct driver definition in SQuirreL to update (probably using JDBC driver class, or have a mapping that maps DBVis "Type" to SQuirreL driver definition?)

    Also, noticed that the URL is not always simple to parse from the URL field. For example, with DB2, I see the following definition:

    <Database id="1">
    <Alias>db2(dbcpdest)</Alias>
    <Url></Url>
    <Driver>DB2</Driver>
    <Userid>myuser</Userid>
    <Profile>auto</Profile>
    <Type>db2</Type>
    <Password>AK+fe8JpLKE2kLaW6+Z31g==</Password>
    <ServerInfoFormat>1</ServerInfoFormat>
    <Properties>
    <Property key="retrieveMessagesFromServerOnGetMessage">true</Property>
    </Properties>
    <UrlFormat>0</UrlFormat>
    <UrlVariables>
    <Driver>
    DB2
    <UrlVariable UrlVariableName="Server">1.2.3.4</UrlVariable>
    <UrlVariable UrlVariableName="Port">50000</UrlVariable>
    <UrlVariable UrlVariableName="Database">DBNAME</UrlVariable>
    </Driver>
    </UrlVariables>
    <SshSettings>
    <SshEnabled>false</SshEnabled>
    <SshHost />
    <SshPort>22</SshPort>
    <SshUserid />
    <SshPassword />
    <SshPrivateKeyFile />
    <SshPassphrase />
    </SshSettings>
    </Database>

    Rob

     
  • Rob Manning
    Rob Manning
    2011-09-07

    • assigned_to: manningr --> nobody
     
  • Fernandezc
    Fernandezc
    2011-09-08

    Sorry, I don't really understand : do you need any other informations ? ( I'm not realy used to use support board)

     
  • Rob Manning
    Rob Manning
    2011-09-08

    I was adding more detail about what a possible solution might do. It will be helpful to whomever picks up this feature to implement it.

    Rob