Showing posts with label SQLSRV. Show all posts
Showing posts with label SQLSRV. Show all posts

Friday, June 14, 2024

how to count rows in sqlserver -->sqlsrv_num_rows

 Example #1 sqlsrv_num_rows() example

<?php
$server
= "serverName\sqlexpress";
$connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password" );
$conn = sqlsrv_connect( $server, $connectionInfo );

$sql = "SELECT * FROM Table_1";
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$stmt = sqlsrv_query( $conn, $sql , $params, $options );

$row_count = sqlsrv_num_rows( $stmt );

if (
$row_count === false)
echo
"Error in retrieveing row count.";
else
echo
$row_count;
?>

Thursday, October 21, 2021

JAVA security for SQL SERVER 2005

 In my case i had a sql server using the 3DES_EDE_CBC algorithm, this is disabled by default on jdk 1.8 , so checking the

/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/lib/security/java.security

And eliminating the algorithm from:

jdk.tls.disabledAlgorithms=                                                                                                                                 SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \ EC keySize < 224, 3DES_EDE_CBC, anon, NULL

Worked for me.



Change to

jdk.tls.disabledAlgorithms=

                   SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \ EC keySize < 224, anon, NULL