Jump to content
razvandragos29

[Solved] Conectare Eclipse cu Sql server Managment Studio 2012

Recommended Posts

Posted

Ok. Pana la urma inteleg ca vrei sa scrii in Java un program care sa se conecteze la SQL Server (faptul ca-l scrii folosind Eclipse, Netbeans sau orice altceva n-are importanta).

Descarci driver-ul de aici ( Microsoft JDBC Driver for SQL Server ) si il adaugi in classpath, apoi scrii in cod Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); ca sa-ti inregistreze driver-ul (forName returneaza un obiect de tip Class care, in cazul asta, nu te ajuta la nimic, doar ca are un efect secundar: iti incarca clasa in JVM si executa un bloc static din interiorul ei) si pe urma poti face ce vrei tu.

Uite aici ce zic cei de la Microsoft: Using the JDBC Driver

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...