Questions tagged [executequery]

Using Java's Statement executeQuery method for getting SQL select results

133 questions
0
votes
1 answer

grails: counting string size using execute query

I just want to know it is possible to convert this line of codes in a single execute Query in Grails. String answer = StudentAnswerData.findWhere(student: studentObject, exam: examObject)?.answer answer.replaceAll('0','')?.size() The code queries…
antibry
  • 282
  • 5
  • 22
0
votes
1 answer

Can DataContext.ExecuteQuery process the whole where statement

I'm trying to fix a problem in an ASP.NET application which uses DataContext.ExecuteQuery to execute sql statement. The query has this part: LEFT OUTER JOIN dbo.Contacts ON dbo.Accounts.SalesRepId = dbo.Contacts.ContactId WHERE " + string.Join(" AND…
Bartosz
  • 4,542
  • 11
  • 43
  • 69
0
votes
2 answers

ResultSet is false in executeQuery Mysql - Java even when row exist

I am fetching two columns from a table in MySql using preparedStatement in Java.The query is valid and returns rows if I execute it on mySql DB directly. but for this method call, ResultSet has values "false" on each ResultSet.next() call. Below is…
0
votes
3 answers

Phalcon MVC model Exception

I'm trying to create an API with Phalcon for the first time. I have been followed the tutorial "http://docs.phalconphp.com/en/latest/reference/tutorial-rest.html", but encountered a problem. I've been created a new project with all the settings, and…
user3079839
  • 1
  • 1
  • 1
0
votes
1 answer

JSP executeQuery not working

I have a basic code but its not working. i don't know why. I checked throughout the code by printing after each line but it seems like executequery is giving me hard time. Need help from experts please <%@ page import="java.net.*, java.io.*,…
user9517536248
  • 355
  • 5
  • 24
0
votes
6 answers

Check username and password in java DataBase and give wrong password message if false

i want to display an error wrong username & password after comparing entered username and password with database of users in java. the problem is it does the if else statement against each row until it gets to the right row b4 displaying "username…
prince_ade
  • 11
  • 1
  • 1
  • 2
0
votes
5 answers

Exception on ExecuteNonQuery method about unsuccessful value convertion

i am using OleDbCommand.ExecuteNonQuery() to insert data into the database: ObjCommand = New OleDbCommand ObjCommand.CommandType = CommandType.StoredProcedure ObjCommand.CommandText = StrSQL ObjCommand.Parameters.Add("field1",…
Marcelo
  • 3,371
  • 10
  • 45
  • 76
0
votes
1 answer

getting error after I am converting the result of ExecuteQuery() output to list

I am using linq to sql for my project. But getting error after I am converting the result of ExecuteQuery() using the .ToList() extension: var logentries = DB.ExecuteQuery(string.Format(query)); keyValueList kv1 =…
sameer pradhan
  • 324
  • 1
  • 4
  • 14
0
votes
1 answer

grails executeQuery with Acos/having/cross-Join

I want to execute a query for zip-search. I've got a domain-model like this: class Zip_data { int zc_loc_id String zc_zip String zc_location_name double zc_lat double zc_lon static constraints = { zc_loc_id() zc_zip() …
Der_V
  • 177
  • 1
  • 16
0
votes
1 answer

How to execute sql scripts from a staging table in sql stored procedure

What are the best approaches to the below scenario? In my C# program, I have some sql commands such as UPDATE, INSERT, DELETE. I could execute them in my C# program (which works fine) but I need to execute these sql commands when one of the stored…
Anirudh
  • 581
  • 5
  • 14
  • 32
0
votes
1 answer

Executing prepared statement with PhP

I'm still very new in PhP, and I have this statement here: SET @sql = NULL; SELECT GROUP_CONCAT(DISTINCT CONCAT( 'GROUP_CONCAT(CASE WHEN `Date` = ''', `Date`, ''' THEN hours ELSE NULL END) AS `', `Date`, '`' ) )…
Iznogud
  • 73
  • 6
0
votes
1 answer

error when update data ms access using visual basic 2010

**i have simple application, but i dont know how to fix it. this pic when i try to edit my database--> http://i861.photobucket.com/albums/ab171/gopak/sa_zps5a950df5.jpg when i click button edit i want my access data will be update.this is my…
0
votes
1 answer

why java connection cannot createstatement() while an executeQuery() is in the middle of processing ?

I have a static java connection to a databases. 1st Thread with my static connection I am creating a statement and call to executeQuery() method. at this point I'm waiting because the query results is very big and I have to wait more than 15…
0
votes
1 answer

Errors for SQL Server connection in asp server

In an asp server we are getting error for SQL Server after executing ExecuteScalar, ExecuteReader and ExecuteNonQuery like shown below. The error will only come sometimes, it's not seen always. So anyone know why does this error comes? How to solve…
IT researcher
  • 3,274
  • 17
  • 79
  • 143
0
votes
1 answer

dbContext.ExecuteStoreQuery does not store objects on dbcontext?

i'm using entityframework 5 and i've noticed that if i load a object from my db using linq my result object is stored on dbcontext, but if i whant to load the same object using the ExecuteStoreQuery, the result is not stored on db context. is this…
Flavio CF Oliveira
  • 5,235
  • 13
  • 40
  • 63
1 2 3
8
9