Showing posts with label connected. Show all posts
Showing posts with label connected. Show all posts

Monday, March 19, 2012

Job Hang when user connected

Hi all,
B.T.W. Sorry for my poor english.
I have database in SQL server 2000 wich user can access with ASP
page. They connect to the database it and return some info.
I got, in SQL Server, a job that run 1 DTS and some stored procedur. It is
running each hour in a day.
I dont know why but when they are web connection to my databse the job
just hang to Step 1 and never end. I have to Stop the Job and restart it.
Again,
if user are connected to my database, the Job just hang. The weird part is
that I can
run the DTS included in the job manually everytime whitout error, even if
user are connected to it ?!
Someone got the same problem
Should I disconnect all user before runnung the job ?
If yes, how can I do that ?
Thanks
Richard
First of all enable DTS package logging as specified in BOL:
To enable package logging
Open the Data Transformation Services (DTS) package for which you want to create a log.
On the Package menu, click Properties to display the DTS Package Properties dialog box.
Do one of the following:
Save package logs to Microsoft? SQL Server? by clicking the Logging tab, selecting the Log package execution to SQLServer check box, and then clicking an available server on which to save the package logs.
Security Note When possible, use Windows Authentication.
Save package logs to SQL Server 2000 Meta Data Services by clicking the Advanced tab, and then selecting the Show lineage variables as source columns and Write lineage to repository check boxes. On the Package menu, click Save As, and then in the Save DTS
Package dialog box, in the Location list, select Meta Data Services.

,... in order to findout the flow of DTS package.
Also refer to SQLAgent log and SQL Server error log for any information on this behaviour.
"Richard Martin" wrote:

> Hi all,
> B.T.W. Sorry for my poor english.
> I have database in SQL server 2000 wich user can access with ASP
> page. They connect to the database it and return some info.
> I got, in SQL Server, a job that run 1 DTS and some stored procedur. It is
> running each hour in a day.
> I dont know why but when they are web connection to my databse the job
> just hang to Step 1 and never end. I have to Stop the Job and restart it.
> Again,
> if user are connected to my database, the Job just hang. The weird part is
> that I can
> run the DTS included in the job manually everytime whitout error, even if
> user are connected to it ?!
> Someone got the same problem
> Should I disconnect all user before runnung the job ?
> If yes, how can I do that ?
>
> Thanks
> Richard
>
>

Job Hang when user connected

Hi all,
B.T.W. Sorry for my poor english.
I have database in SQL server 2000 wich user can access with ASP
page. They connect to the database it and return some info.
I got, in SQL Server, a job that run 1 DTS and some stored procedur. It is
running each hour in a day.
I dont know why but when they are web connection to my databse the job
just hang to Step 1 and never end. I have to Stop the Job and restart it.
Again,
if user are connected to my database, the Job just hang. The weird part is
that I can
run the DTS included in the job manually everytime whitout error, even if
user are connected to it ?!
Someone got the same problem
Should I disconnect all user before runnung the job ?
If yes, how can I do that ?
Thanks
RichardFirst of all enable DTS package logging as specified in BOL:
[i]To enable package logging
Open the Data Transformation Services (DTS) package for which you want to cr
eate a log.
On the Package menu, click Properties to display the DTS Package Properties
dialog box.
Do one of the following:
Save package logs to Microsoft? SQL Server? by clicking the Logging tab,
selecting the Log package execution to SQLServer check box, and then clickin
g an available server on which to save the package logs.
Security Note When possible, use Windows Authentication.
Save package logs to SQL Server 2000 Meta Data Services by clicking the Adva
nced tab, and then selecting the Show lineage variables as source columns an
d Write lineage to repository check boxes. On the Package menu, click Save A
s, and then in the Save DTS
Package dialog box, in the Location list, select Meta Data Services.
[/i]
,... in order to findout the flow of DTS package.
Also refer to SQLAgent log and SQL Server error log for any information on t
his behaviour.
"Richard Martin" wrote:

> Hi all,
> B.T.W. Sorry for my poor english.
> I have database in SQL server 2000 wich user can access with ASP
> page. They connect to the database it and return some info.
> I got, in SQL Server, a job that run 1 DTS and some stored procedur. It i
s
> running each hour in a day.
> I dont know why but when they are web connection to my databse the job
> just hang to Step 1 and never end. I have to Stop the Job and restart it.
> Again,
> if user are connected to my database, the Job just hang. The weird part is
> that I can
> run the DTS included in the job manually everytime whitout error, even if
> user are connected to it ?!
> Someone got the same problem
> Should I disconnect all user before runnung the job ?
> If yes, how can I do that ?
>
> Thanks
> Richard
>
>

Monday, February 20, 2012

JDBC Issue with Varchar

OK..Ive successfully connected to sql server and can execute stored
procedures...if the result set is an integer it prints the result set
but has a bunch of errors:
Execute: com.microsoft.jdbc.base.BaseResultSet@.fc9944
Got from result set: 12345
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Invalid parameter binding(s).
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at
com.microsoft.jdbc.base.BaseCallableStatement.getA ndValidateOutParameter(Unknown
Source)
at com.microsoft.jdbc.base.BaseCallableStatement.getS tring(Unknown
Source)
at JDBC_Test.<init>(JDBC_Test.java:24)
at JDBC_Test.main(JDBC_Test.java:31)
If the result set returns a varchar I get:
Execute: com.microsoft.jdbc.base.BaseResultSet@.fc9944
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value
can not be converted to requested type.
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at com.microsoft.jdbc.base.BaseData.getInteger(Unknow n Source)
at com.microsoft.jdbc.base.BaseResultSet.getInt(Unkno wn Source)
at JDBC_Test.<init>(JDBC_Test.java:22)
at JDBC_Test.main(JDBC_Test.java:31)
Heres my code:
import java.sql.*;
public class JDBC_Test {
private String msDbUrl =
"jdbc:microsoft:sqlserver://localhost:1433;databaseName=KB;selectMethod=cursor ;";
private java.sql.Connection mcDbAccess;
private CallableStatement msProcedure;
public JDBC_Test() {
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLSer verDriver");
mcDbAccess = java.sql.DriverManager.getConnection( msDbUrl,
"kbuser", "password" );
msProcedure = mcDbAccess.prepareCall("{call STP_test(?)
}");
msProcedure.setInt( 1, 1);
ResultSet lrsReturn = null;
System.out.println( "Execute: " + (lrsReturn =
msProcedure.executeQuery() ) );
while( lrsReturn.next() ) {
System.out.println( "Got from result set: " +
lrsReturn.getInt( 1 ) );
}
System.out.println( "Got from stored procedure: " +
msProcedure.getString( 1 ) );
} catch( Throwable e ) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new JDBC_Test();
}
}
Jimbo wrote:
> OK..Ive successfully connected to sql server and can execute stored
> procedures...if the result set is an integer it prints the result set
> but has a bunch of errors:
Ok, and what were you expecting? When an ResultSet containing an
integer is returned, you process that and then you try to get a String
output parameter, which you did not declare as output parameter in the
first place (and probably it isn't a String either, as you pass an
integer as input value for that parameter).
In the second case your procedure returns a ResultSet containing a
character value and you try to read it using getInt()?
Alin.
|||I fixed it...sorry about all the questions..Im still learning this
stuff..thanks for all your help..now that I got the recordset
object...do you have a good link that shows me how to pass that
recordset object to a bean so I can view it in a jsp?
thanks
-Jim