Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Red face Unanswered: SQL Server, VB-script and java???


    I have a database in which I store XML files. I bulkload the files into the database using a vb-script that looks like this.

    Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad.3.0")
    objBL.ConnectionString = "provider=SQLOLEDB.1;data source=X;database=Y;uid=Z;pwd=W"
    objBL.ErrorLogFile = "c:\error.log"
    objBL.Execute "c:\XSDmapping.xml", "C:test.xml"

    Set objBL = Nothing

    This works just fine, but I would like to do it from a java class instead. I
    have set up a JDBC connection so I can query the database from my java application. But is it possible to call the the VB-script from java, or create the bulk load (which is a stand alone COM object) directly in java? or can I somehow call the VB-script from a stored procedure in SQL Server?

    This turned out to be maybe a java-question more than a sql server question, but all help would be greatly appreciated!

  2. #2
    Join Date
    Oct 2003
    Calling VBScript from Java... Bottom line is no. It could be possible but the code would be a nightmare. I've only called VBScript from JavaScript. The problem you'll face is that VBScript and JavaScript is client-side. Java, ASP, and COM are server-side.
    Sounds like you'd be better served placing the bulk insert into a DTS package since you already have a connection into your SQL server. I may be off base here but with my experience with SQL this is the route I'd take. Probably not the answer you wanted to hear.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts