First the null hypothesis can be anything you like; an odds ratio of one is saying that the odds are equal across two groups, but other nulls may be of interest. In a two-by-two contingency table the sample odds ratio $\hat\theta=\frac{n_{11}n_{22}}{n_{12}n_{21}}$, where $n_{ij}$ is the frequency in the $i$th row & $j$th column, can be used as an estimate of the population odds ratio $\theta$. The logarithm of the sample odds ratio converges more quickly to a Gaussian distribution, with a standard error estimate of $$\hat\sigma_{\log\hat\theta}=\sqrt{\frac{1}{n_{11}}+\frac{1}{n_{12}}+\frac{1}{n_{21}}+\frac{1}{n_{22}}}$$; you can use this to obtain (approximate) confidence intervals for the population odds ratio by exponentiating the (approximate) confidence interval bounds for its logarithm. For example 95% bounds can be calculated with $$\exp(\log\hat\theta\pm1.96\hat\sigma_{\log\hat\theta})$$. Hypothesis tests can be formed using the fact that $\frac{\log\hat\theta-\log\theta_0}{\sigma_{\log\hat\theta}}$ has a standard normal distribution under the null hypothesis $\theta=\theta_0$. For a null hypothesis of $\theta=1$, that's $\log\theta=0$.
Note that Fisher's Exact Test can be viewed as using the sample odds ratio as a test statistic, even though it may not be explicitly calculated. The difference is that its distribution is calculated exactly, conditional on both sets of marginal totals, rather than approximated from large-sample theory.