Quantcast

SOLVED??? RE: Scripting MS SQL 2012 stored procedure

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SOLVED??? RE: Scripting MS SQL 2012 stored procedure

Alex Malmyguine-2

If it helps anyone, here’s how I was able to debug the MS SQL plugin:

 

Built with ant,

Copied the plugin


\SquirrelSQL\squirrel-sql-git\sql12\output\dist\plugins\mssql.jar

 

to

 

\SquirrelSQL\plugins\mssql.jar

 

And now I can no longer reproduce the issue with either JTDS or MS JDBC drivers – both script the procedures just fine, both under debugger and in the installed SquirrelSQL instances.

The only thing I can blame would be memory pressure. For quite some time I was running very low on free RAM and guess that could cause the plugin to fail obtaining the SP source from the server.

If the line 70 of ScriptProcedureCommand.execute() would fail to obtain source, than and all the user would see would be GO as in my case.

The following few extra lines might hint the user at the problem:

 

                    int l = buf.length();

                    buf.append(MssqlIntrospector.getHelpTextForObject(MssqlIntrospector.getFixedVersionedObjectName(ti.getSimpleName()),conn));

                    if (buf.length() == l) {

                        buf.append("--Failed to obtain object source code from JDBC driver");

                    }

                    else {

                        buf.append("\n");

                        buf.append(sqlSep);

                        buf.append("\n\n");

                    }

 

Thank you

Alex

 

From: Alex Malmyguine
Sent: Friday, November 13, 2015 3:50 PM
To: Alex Malmyguine; Neville Rowe
Cc: [hidden email]
Subject: RE: [Squirrel-sql-users] Scripting MS SQL 2012 stored procedure

 

But now I have another question!

Even though the MSSql plugin sources were included into the project, the plugin does not seem to be built.

When Squirrel starts, the plugin list pointing at \SquirrelSQL\plugins where \SquirrelSQL is the main project folder, is empty.

I created the folder \SquirrelSQL\plugins, but how can I configure the project to output the plugin JAR in there?

 

Thank you

Alex

 

From: Alex Malmyguine
Sent: Friday, November 13, 2015 1:49 PM
To: Neville Rowe
Cc: [hidden email]
Subject: Re: [Squirrel-sql-users] Scripting MS SQL 2012 stored procedure

 

Neville,

 

After comparing yours and mine it became apparent that your project included the individual JARs, whereas mine included the /lib/ folder (as instructed by the document linked earlier).

So it sounds like Netbeans 8 pretends it supports adding a folder as a library by pressing “Add JAR/folder” button, but in fact ignores so imported JARs.

I started adding the jars one by one instead and it worked! Ended up adding all JARs from the /lib/ folder and all errors became resolved.

 

Thank you

Alex

 

From: Neville Rowe [[hidden email]]
Sent: Thursday, November 05, 2015 6:48 AM
To: Alex Malmyguine
Cc: [hidden email]
Subject: RE: [Squirrel-sql-users] Scripting MS SQL 2012 stored procedure

 

Hi Alex,

 

I also use netbeans for Squirrel and it works for me so I guess there is a difference in our setups. I'm on latest Netbeans and Squirrel.

 

I find the trick is to setup Netbeans to know about sql12/core/src and then just the one plugin I happen to be working on at the time.

 

I've enclosed my build.xml and my nbproject/project.xml - note my git checkout is to p:\NetBeansProjects\SquirrelSQL\git and my project root is p:\NetBeansProjects\SquirrelSQL.

 

It could be that for a free-form project in NetBeans, the classpath within NetBeans doesn't pick up from the build.xml - in which case the below error would be from the IDE (cannot find the libraries) rather than the ANT build? The project.xml I've attached sets up an appropriate java sources classpath, though you can set one yourself by going into Project Properties in the IDE.

 

Hope this helps.

 

Neville


From: [hidden email]
To:
[hidden email]
Date: Tue, 3 Nov 2015 23:03:54 +0000
Subject: Re: [Squirrel-sql-users] Scripting MS SQL 2012 stored procedure

I wanted to troubleshoot the issue below and checked out the source code from git, built with Ant successfully and created a project in Netbeans from the sources.

After I followed this http://squirrel-sql.sourceforge.net/index.php?page=programing and opened the directory core/src in Netbeans, I cannot compile due to an error stating the org.apache etc packages are not found.

But I can see the commons* packages in the project tree.

What am I doing wrong?

 

Thank you

Alex

 

From: Alex Malmyguine [[hidden email]]
Sent: Wednesday, October 28, 2015 10:51 AM
To:
[hidden email]
Subject: [Squirrel-sql-users] Scripting MS SQL 2012 stored procedure

 

Good morning,

 

Using version 3.6 with either MS JDBC 4.1 driver or JTDS 1.3.1 driver, I can list the stored procedures in a schema, then use popup menu/SQL server/Script procedure.

But it opens SQL tab with only a GO statement on the 2nd line in the editor. What am I doing wrong?

 

Thank you!

Alex


------------------------------------------------------------------------------
_______________________________________________ Squirrel-sql-users mailing list
[hidden email] https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users


------------------------------------------------------------------------------

_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Loading...