Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

How to validate query string or determine if exception was from a bad query string (no replies)

$
0
0
Hi,

I'm developing a system that communicates with MySQL and Oracle. The system is pretty much automatic, so there isn't a user to be monitoring the program all the time.

Q1: I could get a query that has badly formated string. As I execute such query the result is a MySQLException. How do I know from that exception, that it was because of the badly formated string? I need to know this because the exception could rise on communication error (or any other) too.

Q2: Because I get a lot of querys, I'm using a thread to communicate MySQL. The thread keeps a single connection open so I don't get too many connections. The problem is server side could close the connection if there isn't activity for some time (like 100 seconds). Is there some method that 'refreshes' the communication = says the server: 'Hey, I'm still here! Don't close the connection.' Or, should I just do some simple query on the database every now and then?

Thanks,

-Maukka

Viewing all articles
Browse latest Browse all 1447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>