sql « SQLserver « Java Database Q&A





1. How to deal with SQL column names that look like SQL keywords?    stackoverflow.com

One of my columns is called "from". I can't change it, I didn't make it. Am I allowed to do something like "SELECT from FROM TableName"? Or is there a special syntax to avoid ...

2. Whats the best way to update a single record via SQL and obtain the id of the record that was updated? (Java/MSSQL)    stackoverflow.com

I know I can update a single record like this - but then how to I get access to the id of the record that was updated? (I'm using MSSQL ...

3. How to determine SQL that corresponds to SQL Server's sp_unprepare call?    stackoverflow.com

This is probably quite basic, so bear with me (on the other hand there's probably a nice shiny cut-and-dried answer!). I'm diagnosing a deadlocking problem at the moment, and indeed I can ...

4. SQL Server 2000 blocking problem solved by running profiler?    stackoverflow.com

We are working on a large Java program that was converted from a Forte application. During the day we are getting Blocking SPID's in the server. We had a DBA visit ...

5. Create a Java Stored Procedure in MS SQL Server 2005    stackoverflow.com

Can I create a java stored procedure in MS SQL Server 2005 like in Oracle or DB2?

6. SQL Server / JDBC Connectivity Issues    stackoverflow.com

I am experiencing some strange behaviour in my Java server application whereby database operations that usually take a few milliseconds are sporadically taking much longer (30s - 170s) to complete. ...

7. SQL Server statement with subselect is invalid    stackoverflow.com

Hey, I am using iBATIS with SQL Server Compact Edition 3.5 and try to do a subselect

INSERT INTO FORMINSTANCE (ID, ID_FORM) 
  SELECT #ID#, f.ID 
  FROM FORM f ...

8. How to validate sql query syntax?    stackoverflow.com

java 1.4 Sql server 2000 i am taking input of sql query (for validation of field value against values retrieved by executing sql query) from admin user which will be stored in database ...

9. java 1.4 -sql server2000:is it safe to append text to String in java of size in gbs    stackoverflow.com

i am dynamically creating sql query for inserting multiple records in one hit.Suppose no of record to be inserted is 1000.in that case sql query will be generated as below in ...





10. sql sever datainsert error    stackoverflow.com

I try this code this is problem to pass value in mssqlserver i pass value one page to another page in hear nrno is value come to other page but hear ...

11. Java seems to be truncating long string result from MS-SQL query    stackoverflow.com

So I've got a query in a JSP class that retrieves, basically, the entire contents of a table as a string using MS SQL's "FOR XML AUTO" feature. I.e., select * from ...

12. how to get seconds from java long, I'm storing it in mssql DB as bigint    stackoverflow.com

I store the long values in mssql using bigint so I could do something like this:

--@start and @end are bigint
set @duration = @start - @end
now I need some additional operation so ...

13. Defending against a 'WAITFOR DELAY' sql injection attack?    stackoverflow.com

The problem We need to defend against a 'WAITFOR DELAY' sql injection attack in our java application. Background [This is long. Skip to 'Solution?' section below if you're in a rush ] Our application mostly ...

14. How can I get SQL Sever Tables to appear in Reverse Engineering Wizard?    stackoverflow.com

I don't do much Java coding so I am not too familiar with the NetBeans IDE. I am trying to create a reverse engineering file based on a SQL Server connection ...

15. Find SQL Servers using Java    stackoverflow.com

This might be a basic question, but I tried googling it and couldn't find an answer. I need to make a list of all the SQL Servers on a network. This ...

16. How do I query SQL Browser Service from Java?    stackoverflow.com

This might be a basic question, but I tried googling it and couldn't find an answer. I need to make a list of all the SQL Servers on a network. This is ...





17. Once I have the name of a SQLServer, how do I list its databases in java?    stackoverflow.com

I am trying to populate a drop down list of SQLServers on a network using the osql -L command through Java. The user will then choose a server and type ...

18. Mapping complex result set with Dom4j    stackoverflow.com

I'm trying to create an XML document from a complex result set, i.e. a result set with multiple joins, so a competition has a bunch of questions, and a question has ...

19. Which jar to use for connecting to MS SQL server    stackoverflow.com

Can some one please guide me to understand which jar file i need to include in my application to be able to set up a jdbc connection with ms sql server. thanks ...

20. Database persistence without an SQL server    stackoverflow.com

I'm seeking a solution that would allow persistence without requiring an SQL server to be installed on the host and could be bundled along with a desktop application. Does such a ...

21. java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to X    stackoverflow.com

I'm using Hibernate 3.2.1 and database SQLServer2000 while I'm try to insert some data using my dao, some warning occurred like this:

java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to BTN_SPP_DB
  ...

22. Hadoop and MS SQL Server Best Practices    stackoverflow.com

I've been following Hadoop for a while, it seems like a great technology. The Map/Reduce, Clustering it's just good stuff. But I haven't found any article regarding the use of Hadoop ...

23. Get CURRENT_TIMESTAMP as part of ResultSet    stackoverflow.com

is there any way of retrieving database generated values in Java other than IDENTITY fields? I can easily get IDENTITY values from a ResultSet, but I'd like to get the value ...

24. java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library    stackoverflow.com

I have two web-applications which need to run on Tomcat 6, MS SQL 2008 and JTDS-1.2.2 as driver. If I start only one web application everything is working fine, but as soon ...

25. SQL server 2008 - how to get column name and value together?    stackoverflow.com

I'm not sure if it's possible.. I'm using SQL server 2008 and Java. I have a table

--------------
|   users    |
--------------
|  name      |
| ...

26. Connecting to SQL Server from java with TCP disabled    stackoverflow.com

I'm trying to connect to a local database (SQL Server 2008) from Java. I have disabled the tcp connections per customer requirements and I can't connect. I have to disable too the service ...

27. No resultset if the store procedures does an update before the select on MSSQL server 2005    stackoverflow.com

Does any one have any idea why I wont get a resultset if I do an update before the select in a store procedure. Im running MSSQL server 2005 and the ...

28. java.sql.SQLException: Invalid state, the ResultSet object is closed    stackoverflow.com

I am trying to run StoredProcedure using jtds. My database is on SQL SErver 2008

private String DRIVER_NAME_VALUE = "net.sourceforge.jtds.jdbc.Driver";  
private String URL_VALUE = "jdbc:jtds:sqlserver://"; 
...
cstmt =dbConnection.getCallableStatement("{? = call dbo.GetAgentStats (?)}");
.
.
.
rs = ...

29. Java alternative to SQL Server 2008 - Compact    stackoverflow.com

I am looking to get started with SQL development and as such have decided to implement an application in both Java and C# that makes use of an SQL based database, ...

30. jdbc sql server error: java.sql.SQLException: No suitable driver    stackoverflow.com

I'm using eclipse, trying to connect to a sql server db. I have the jars in my build path. I get the error:

java.sql.SQLException: No suitable driver ...

31. Can I amend the executed SQL before execution using an AspectJ pointcut    stackoverflow.com

I'm trying to add a specific piece of SQL to all SQL executed in a system using AspectJ. I've not used AspectJ before but I believe what I need to do is ...

32. java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver    stackoverflow.com

I'm getting this exception when I try to run this program. It's one of the Microsoft examples. I've added the sqljdbc4.jar to the classpath in netbeans for both compile and Run, ...

33. Connect with SQL Server 2005 Express with Java    stackoverflow.com

I have problem with my project. It's making me crazy - maybe you can help me. I have a PC running SQL server 2005 Express and it works nicely. In Eclipse I tested ...

34. Problem connecting to SQL Server from Java    stackoverflow.com

My program didn't give errors but it didn't connect to SQL Server. Which processes must I run in SQL Server Configuration Manager besides browser? Should I run SQL Server agent and ...

35. Is there a java.sql.Connection class's equivalent function for SQL Server sp_resetconnection functionality?    stackoverflow.com

Imagine a simple connection pool for java.sql.Connection. After the connection has been released back to the pool we have no idea if any transactions are open, any temporary tables created, ...

36. Getting a result set from a SQL SERVER stored procedure using GROOVY SQL    stackoverflow.com

I'm trying to get a result set from a stored procedure in SQL SERVER (2005 I believe) from within my GRAILS app. (Grails 1.3.2, Groovy 1.7.6) The stored procedure runs fine with ...

37. JDBC | MSSQL connection error    stackoverflow.com

I'm trying to generate some reports to my system using Jasper reports. I'm suing basic JDBC connection method to establish a connection to my MSSQL 2000 server. Here is my code ...

38. Connecting to Microsoft SQL Server using Clojure    stackoverflow.com

I am trying to connect to Microsoft SQl Server 2008 database using windows authentication. I have downloaded the JDBC driver for MS SQL Server and added that to my CLASSPATH. Below is my ...

39. Access data cube generated by Microsoft MSSQL BI    stackoverflow.com

I am working on a project where I am hoping to use Microsoft MSSQL Business Intelligence to create data cubes, then access the processed data like browsing them in the BI ...

40. What is the difference between Java and C# when it comes to connect to Sql Server Database?    stackoverflow.com

I am writing an application requires to connect to sql server. I prefer to write the App in Java. but When I try to connect to the server I got the ...

41. Comparing sql query resultsets in java    stackoverflow.com

I want to run a query programmatically using java on a sql server database running on our dev environment and production environment and compare the results. would doing a column by ...

42. A cursor with the name ... already exists - SQL Server 2008    stackoverflow.com

I have a trigger that is used to perform some auditing tasks when changes are made to a table. Within this trigger there is a WHILE loop, and in the loop ...

43. Representing dates which are a certain number of days before or after another date in a RDBMS    stackoverflow.com

Is there a standard way to represent dates which are a certain number of days before or after another date in an RDBMS? For example, let's say Date 1 is 30th October, ...

44. How do I declare a String array in a Java SQL declareParameter call?    stackoverflow.com

Simplified for illustrative purposes:

String[] filter = {"foo", "bar"};
String sql = "SELECT * FROM table WHERE column IN ?";
declareParameter(new SqlParameter(Types.ARRAY));
This doesn't work when I execute it (I get a java.sql.SQLException: [Microsoft][SQLServer 2000 ...

45. SQL Server - how to ensure query results are cached?    stackoverflow.com

I have an application whose first page after login presents the user with a lot of data. The query against the database takes a long time - let's say 10 seconds. ...

46. Java SQL query prepare statement dynamic parameter    stackoverflow.com

Im daling with sql query using java with parameters that maybe exists or not in a query. For example, there is a http request parameter of :

  1. name
  2. start
  3. limit
in the jsp, i did something ...

47. Java : save data from UTF-8 file into Sql Server 2008    stackoverflow.com

I failed to save data with accents from utf8 file into my SQL Server 2008 table - SQL collation = SQL_Latin1_General_CP1_CI_AS - (when I do a System.out.print of my insert statement ...

48. Connect with JDBC to SQLCE (compact edition) HELP?    stackoverflow.com

I am trying to connect to *.sdf file with jdbc and I think my url is wrong. It was easier to provide url to a regular sql server but to sdf I ...

49. Error when using JDBC Driver- java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver    stackoverflow.com

I am trying to use the Microsoft SQL Server 2008 Type 4 JDBC Driver in a java desktop application. However when I run the program I get the following error--

java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
How do ...

50. Building an MSSQL database with ColdFusion or Java from an ".sql" file?    stackoverflow.com

I have a .sql file that was created using the MS SQL Management Studio Script Wizard. It contains the entire database schema including views, stored procedures, tables, indexes, etc. I’m looking ...

51. Get row count of a resultset in java    stackoverflow.com

I'm trying to create a simple method that excepts a ResultSet as a parameter and sends back an int that contains the row count of the ResultSet. Is this a valid ...

52. Cannot connect to SQL Server 2005 database with sql power architect    stackoverflow.com

it's my first use of power architect and i am trying to connect to sql server 2005 (Express) db on a remote machine (i can connect to it successfully from Microsoft sql ...

53. cannot connect java app to sql server 2008 R2    stackoverflow.com

I'm using SQL Server Express 2008 R2. When i run project in Netbeans, it works fine with server name : localhost; port : 1433. But when i try to run app ...

54. tables_sqlServer.sql fails    forums.terracotta.org

Hi, i wanted to use the jdbc job store and run the tables_sqlServer.sql script. The last two commands failed however. Maybe its an sqlserver 2005 issue? I did some inspecting and there are two possible solutions: 1. Add the [SCHED_NAME] to the last two FK constraints -> which implies that the [SCHED_NAME] is the same in QRTZ_SIMPROP_TRIGGERS and QRTZ_TRIGGERS tables (and ...

55. list of sql servers    coderanch.com

Hi, Im trying to get the list of sql servers available. For this, I wrote a batch file with the command "osql /L > C:\servers.txt" when i try to read this file from java class, it is able to read the content successfully (Rather most of the times... ) However, sometimes...... it doesn't ...??? I really wonder what could be the ...

60. java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing.    coderanch.com

Hi, i am trying to establish the jdbc connection using sql server 2000 and i am using winows 7 operating system and jdk 1.6. when i run the application it is giving the following exception java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSConnection.(Unknown Source) at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source) ...

61. SQL Servers view meta data(urgent)    dbforums.com

Hi all, I want to extract constraints within the views definition. for example in such a view definition query: " create view student_view as select stdid, stdname from student_table where stdid > 675; " how can i extract (stdid > 675) from any tables or views in Sql server 2000? (I don't like to parse "create view ..." query!) -thanks in ...

63. MS SQL Error SQL 137    forums.oracle.com